- client: in choosing coproc jobs to run (FIFO) give priority

to whether job is already running.
    This addresses a bug where several jobs are returned by sched RPC,
    and one with a lexicographically greater name
    happens to finish downloading first.

svn path=/trunk/boinc/; revision=19092
This commit is contained in:
David Anderson 2009-09-18 17:11:15 +00:00
parent 2e702db323
commit cffbef1372
2 changed files with 19 additions and 3 deletions

View File

@ -7856,3 +7856,13 @@ David 18 Sept 2009
sysmon_win.cpp
lib/
proxy_info.cpp,h
David 18 Sept 2009
- client: in choosing coproc jobs to run (FIFO) give priority
to whether job is already running.
This addresses a bug where several jobs are returned by sched RPC,
and one with a lexicographically greater name
happens to finish downloading first.
client/
cpu_sched.cpp

View File

@ -306,7 +306,11 @@ RESULT* CLIENT_STATE::largest_debt_project_best_result() {
return rp;
}
// return coproc jobs in FIFO order
// Return coproc jobs in FIFO order
// Give priority to already-started jobs because of the following scenario:
// - client gets several jobs in a sched reply and starts download files
// - a job with a later name happens to finish downloading first, and starts
// - a job with an earlier name finishes downloading and preempts
//
RESULT* first_coproc_result() {
unsigned int i;
@ -321,10 +325,12 @@ RESULT* first_coproc_result() {
best = rp;
continue;
}
if (rp->received_time < best->received_time) {
if (!rp->not_started() && best->not_started()) {
best = rp;
} else if (rp->received_time < best->received_time) {
best = rp;
} else if (rp->received_time == best->received_time) {
// make it deterministic
// make it deterministic by looking at name
//
if (strcmp(rp->name, best->name)) {
best = rp;