From 5a5b38631362d5afaa19a4d51679a02600e8dd9e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 23 Mar 2009 01:33:17 +0000 Subject: [PATCH] - client: garbage collect after scheduler RPC; if project sent some irrelevant FILE_INFOs, this will avoid starting transfers for them. svn path=/trunk/boinc/; revision=17644 --- api/boinc_api.cpp | 2 +- checkin_notes | 13 +++++++++++++ client/cs_scheduler.cpp | 5 +++++ client/gui_rpc_server_ops.cpp | 2 +- samples/multi_thread/multi_thread.cpp | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/api/boinc_api.cpp b/api/boinc_api.cpp index 5a358b9249..3c6903edc8 100644 --- a/api/boinc_api.cpp +++ b/api/boinc_api.cpp @@ -887,7 +887,7 @@ static void timer_handler() { if (interrupt_count % TIMERS_PER_SEC) return; #ifdef DEBUG - fprintf(stderr, "%f: 1 sec elapsed\n"); + fprintf(stderr, "%f: 1 sec elapsed\n", dtime()); #endif // here it we're at a one-second boundary; do slow stuff diff --git a/checkin_notes b/checkin_notes index f3f50a9bd2..574fa84985 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3207,3 +3207,16 @@ David 20 Mar 2009 html/inc/ host.inc + +David 20 Mar 2009 + - client: garbage collect after scheduler RPC; + if project sent some irrelevant FILE_INFOs, + this will avoid starting transfers for them. + api/ + boinc_api.cpp + client/ + cs_scheduler.cpp + gui_rpc_server_ops.cpp + samples/multi_thread/ + multi_thread.cpp + diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index 1b1211c88b..b1d6a5ff68 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -950,6 +950,11 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url) project->set_min_rpc_time(x, "requested by project"); } + // garbage collect in case the project sent us some irrelevant FILE_INFOs; + // avoid starting transfers for them + // + gstate.garbage_collect_always(); + return 0; } diff --git a/client/gui_rpc_server_ops.cpp b/client/gui_rpc_server_ops.cpp index fd881e052e..885dceca13 100644 --- a/client/gui_rpc_server_ops.cpp +++ b/client/gui_rpc_server_ops.cpp @@ -910,7 +910,7 @@ static void read_all_projects_list_file(MIOFILE& fout) { static int set_debt(XML_PARSER& xp) { bool is_tag; char tag[256], url[256]; - double short_term_debt = 0.0, long_term_debt = 0.0, cuda_debt; + double short_term_debt = 0, long_term_debt = 0, cuda_debt=0; bool got_std=false, got_ltd=false, got_cuda_debt=false; strcpy(url, ""); while (!xp.get(tag, sizeof(tag), is_tag)) { diff --git a/samples/multi_thread/multi_thread.cpp b/samples/multi_thread/multi_thread.cpp index 2a3f88ea16..0bf6ae60b6 100644 --- a/samples/multi_thread/multi_thread.cpp +++ b/samples/multi_thread/multi_thread.cpp @@ -171,7 +171,7 @@ void* worker(void* p) { for (int i=0; iunits_done++; - fprintf(stderr, "thread %d finished %d: %f\n", t->index, i, x); + fprintf(stderr, "%f: thread %d finished %d: %f\n", dtime(), t->index, i, x); } t->id = THREAD_ID_NULL; #ifdef _WIN32