*** empty log message ***

svn path=/trunk/boinc/; revision=2960
This commit is contained in:
David Anderson 2004-02-04 23:18:14 +00:00
parent c1ff78f74a
commit 73ee790545
7 changed files with 79 additions and 20 deletions

View File

@ -9760,3 +9760,25 @@ David Feb 4 2004
Karl 2004-02-03
- more misc. make_project fixes
David Feb 4 2004
- define a destructor for ACTIVE_TASK.
Do all resource deallocation (close thread/proc/msg handles;
detach and/or destroy shmem) here.
This deallocation was being done piecemeal;
for example, it wasn't being done if the process was aborted.
Hence the "quit message" object was still there,
and when another process started in the same slot it would
immediately get the message (caused "reset project" problem)
- Eventually delete all ACTIVE_TASK objects.
The following removed them from the list but didn't deleting:
ACTIVE_TASK_SET::abort_project()
ACTIVE_TASK_SET::restart_tasks() (failure case)
- Don't ask for work if we have any unfinished work.
This is a temporary kludge to prevent repeated work requests;
it means that min work buffer is meaningless.
But maybe this is OK.
client/
app.h,C
cs_scheduler.C

View File

@ -118,6 +118,35 @@ ACTIVE_TASK::ACTIVE_TASK() {
checkpoint_cpu_time = 0;
current_cpu_time = 0;
working_set_size = 0;
#ifdef _WIN32
pid_handle = 0;
thread_handle = 0;
quitRequestEvent = 0;
shm_handle = 0;
#endif
}
ACTIVE_TASK::~ACTIVE_TASK() {
#ifdef _WIN32
if (pid_handle) CloseHandle(pid_handle);
if (thread_handle) CloseHandle(thread_handle);
if (quitRequestEvent) CloseHandle(quitRequestEvent);
// detach from shared mem.
// This will destroy shmem seg since we're the last attachment
//
if (app_client_shm.shm) {
detach_shmem(shm_handle, app_client_shm.shm);
app_client_shm.shm = NULL;
}
#else
// detach from and destroy share mem
//
if (atp->app_client_shm.shm) {
detach_shmem(atp->app_client_shm.shm);
atp->app_client_shm.shm = NULL;
}
destroy_shmem(atp->shm_key);
#endif
}
int ACTIVE_TASK::init(RESULT* rp) {
@ -598,6 +627,7 @@ bool ACTIVE_TASK_SET::check_app_exited() {
atp = active_tasks[i];
if (GetExitCodeProcess(atp->pid_handle, &exit_code)) {
if (exit_code != STILL_ACTIVE) {
msg_printf(NULL, MSG_INFO, "Process exited with code %d", exit_code);
atp->get_status_msg();
atp->result->final_cpu_time = atp->checkpoint_cpu_time;
found = true;
@ -621,19 +651,9 @@ bool ACTIVE_TASK_SET::check_app_exited() {
);
}
}
CloseHandle(atp->pid_handle);
CloseHandle(atp->thread_handle);
CloseHandle(atp->quitRequestEvent);
atp->read_stderr_file();
clean_out_dir(atp->slot_dir);
// detach from shared mem. This will destroy shmem seg
// since we're the last attachment
//
if (atp->app_client_shm.shm) {
detach_shmem(atp->shm_handle, atp->app_client_shm.shm);
atp->app_client_shm.shm = NULL;
}
}
}
}
@ -695,14 +715,6 @@ bool ACTIVE_TASK_SET::check_app_exited() {
atp->read_stderr_file();
clean_out_dir(atp->slot_dir);
// detach from and destroy share mem
//
if (atp->app_client_shm.shm) {
detach_shmem(atp->app_client_shm.shm);
atp->app_client_shm.shm = NULL;
}
destroy_shmem(atp->shm_key);
return true;
}
#endif
@ -931,6 +943,7 @@ int ACTIVE_TASK_SET::abort_project(PROJECT* project) {
atp = *task_iter;
if (atp->result->project == project) {
task_iter = active_tasks.erase(task_iter);
delete atp;
} else {
task_iter++;
}
@ -1048,6 +1061,7 @@ int ACTIVE_TASK::unsuspend() {
// Remove an ACTIVE_TASK from the set.
// Do this only if you're sure that the process has exited.
// Does NOT delete the ACTIVE_TASK object.
//
int ACTIVE_TASK_SET::remove(ACTIVE_TASK* atp) {
vector<ACTIVE_TASK*>::iterator iter;
@ -1094,6 +1108,7 @@ int ACTIVE_TASK_SET::restart_tasks() {
"Couldn't restart the app for this result: %d", retval
);
active_tasks.erase(iter);
delete atp;
} else {
iter++;
}

View File

@ -104,6 +104,7 @@ public:
int link_user_files();
ACTIVE_TASK();
~ACTIVE_TASK();
int init(RESULT*);
int start(bool first_time); // start the task running

View File

@ -427,7 +427,12 @@ bool CLIENT_STATE::scheduler_rpc_poll() {
if (exit_when_idle && contacted_sched_server) {
should_get_work = false;
} else {
below_work_buf_min = (current_work_buf_days() <= global_prefs.work_buf_min_days);
// TODO: the following is a kludge to prevent
// repeated work requests, but it defeats the
// work_buf_min concept
//
//below_work_buf_min = (current_work_buf_days() <= global_prefs.work_buf_min_days);
below_work_buf_min = (current_work_buf_days() == 0);
should_get_work = below_work_buf_min && some_project_rpc_ok();
}
if (should_get_work) {

View File

@ -21,6 +21,12 @@ To increase the efficiency of data access,
views are broken into a number of files,
each containing a fixed number of records.
<p>
For files that are ordered by ID,
each file contains a fixed-size segment of the ID range,
not a fixed number of records.
If the database ID allocation has gaps,
files will have fewer than this number of records.
<p>
The entries in a given file are in either 'summary' or 'detail' form.
For example, the summary of a team gives its ID, name, and credit,
while the detailed from also contains a list of its members.

View File

@ -49,15 +49,23 @@ Administrivia:
Build
Windows:
NOTE: currently we are distributing the debug version of the core client.
This is reflected in:
- where you copy dbghelp.dll to
- the "File Groups" tab of Installshield (link type)
Use the HP Kayak windows box (bart) in 329 or the Dell (skinner) in 325.
set up:
bart: Open 'quarl' on the desktop.
skinner: Open 'build' on the desktop.
other: check out new source tree; copy Media.zip into win_build/installer; unzip
other:
check out new source tree
copy Media.zip into win_build/installer; unzip
make sure "Media" is at top level of installer
Right-click on top BOINC folder;
CVS/preferences/policy; clear "prune empty folders" checkbox
copy "client/win/dbghelp.dll" to "win_build/Build/Debug"
Open 'BOINC'

View File

@ -16,6 +16,8 @@ create_work
-redundancy n // # of results to create
-db_name x // database name
-db_passwd x // database password
-db_host x // database host
-db_user x // database user name
-upload_url x // URL for output file upload
-download_url x // base URL for input file download
-download_dir x // where to move input files