From 39561fbc56131f541f17b057c79b638e5b5f54ff Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 24 May 2005 00:39:50 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=6229 --- client/cs_apps.C | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/client/cs_apps.C b/client/cs_apps.C index 7f6adc0af8..128455e77f 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -478,13 +478,25 @@ bool CLIENT_STATE::schedule_cpus(double now) { double debt_inc = (p->resource_share/local_total_resource_share) * cpu_sched_work_done_this_period - - p->work_done_this_period; - p->long_term_debt += debt_inc; + - p->work_done_this_period + ; + // if the project is suspended or communications is deferred or + // the user has asked for no work. + // This prevents projects that are not supplying + // work from running away too quickly. + // They will still accumulate LT debt when we are not asking. + // exception for rpc time and don't request work + // is work being processed currently + // + double current_work = ettprc(p,0); + if (!p->suspended_via_gui && ((p->min_rpc_time < now && !p->dont_request_more_work) || current_work > 0)) { + p->long_term_debt += debt_inc; + } total_long_term_debt += p->long_term_debt; if (!p->next_runnable_result) { p->debt = 0; p->anticipated_debt = 0; - } else { + } else { p->debt += debt_inc; if (first) { first = false;