diff --git a/checkin_notes b/checkin_notes index 2485fd7c75..afb62f6b2c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -23236,3 +23236,20 @@ Rom 24 Jan 2005 / configure.ac + +David 25 Jan 2005 + Policy change: apps of non-CPU-intensive projects are never suspended + - Change ACTIVE_TASK_SET::suspend_all() and unsuspend_all() + to skip non-CPU-intensive projects. + - Ignore GUI RPC requests to suspend non-CPU-intensive projects or results + - Add the non_cpu_intensive flag to GUI RPC's PROJECT structure. + GUIs should not show suspend/resume buttons + for non-CPU-intensive projects or results + + client/ + app_control.C + gui_rpc_server.C + lib/ + gui_rpc_client.C,h + html/project.sample/ + project.inc diff --git a/client/app_control.C b/client/app_control.C index 5d12c1bf21..e542077546 100644 --- a/client/app_control.C +++ b/client/app_control.C @@ -717,6 +717,7 @@ void ACTIVE_TASK_SET::suspend_all(bool leave_apps_in_memory) { for (i=0; itask_state != PROCESS_EXECUTING) continue; + if (atp->result->project->non_cpu_intensive) continue; if (leave_apps_in_memory) { atp->suspend(); } else { @@ -733,6 +734,7 @@ void ACTIVE_TASK_SET::unsuspend_all() { ACTIVE_TASK* atp; for (i=0; iresult->project->non_cpu_intensive) continue; if (atp->scheduler_state != CPU_SCHED_SCHEDULED) continue; if (atp->task_state == PROCESS_UNINITIALIZED) { if (atp->start(false)) { diff --git a/client/gui_rpc_server.C b/client/gui_rpc_server.C index 81cd45ac39..4165e55266 100644 --- a/client/gui_rpc_server.C +++ b/client/gui_rpc_server.C @@ -162,7 +162,11 @@ static void handle_project_op(char* buf, MIOFILE& fout, char* op) { if (!strcmp(op, "reset")) { gstate.reset_project(p); } else if (!strcmp(op, "suspend")) { - p->suspended_via_gui = true; + if (p->non_cpu_intensive) { + msg_printf(p, MSG_ERROR, "Can't suspend non-CPU-intensive project"); + } else { + p->suspended_via_gui = true; + } } else if (!strcmp(op, "resume")) { p->suspended_via_gui = false; } else if (!strcmp(op, "detach")) { @@ -390,7 +394,11 @@ static void handle_result_op(char* buf, MIOFILE& fout, char* op) { rp->aborted_via_gui = true; } } else if (!strcmp(op, "suspend")) { - rp->suspended_via_gui = true; + if (p->non_cpu_intensive) { + msg_printf(p, MSG_ERROR, "Can't suspend non-CPU-intensive result"); + } else { + rp->suspended_via_gui = true; + } } else if (!strcmp(op, "resume")) { rp->suspended_via_gui = false; } diff --git a/html/project.sample/project.inc b/html/project.sample/project.inc index 7f4e013cce..ac953c6ef7 100644 --- a/html/project.sample/project.inc +++ b/html/project.sample/project.inc @@ -40,33 +40,30 @@ function project_footer($show_return, $show_date) { } } -// NOTE: These functions appear here and not in profile.inc because they contain -// project-specific information that needs to be set by the project administrators. - function show_profile_heading1() { - row1("Your personal background."); + return "Your personal background."; } function show_profile_question1() { - rowify(" + return " Tell us about yourself. You could tell us where you're from, your age, occupation, hobbies, or anything else about yourself. - "); + "; } function show_profile_heading2() { - row1("Your opinions about " . PROJECT); + return "Your opinions about " . PROJECT; } function show_profile_question2() { - rowify(" + return " Tell us your thoughts about " . PROJECT . "
  1. Why do you run " . PROJECT . "?
  2. What are your views about the project?
  3. Any suggestions?
- "); + "; } ?> diff --git a/lib/gui_rpc_client.C b/lib/gui_rpc_client.C index c4d981b839..1160368c45 100644 --- a/lib/gui_rpc_client.C +++ b/lib/gui_rpc_client.C @@ -103,6 +103,10 @@ int PROJECT::parse(MIOFILE& in) { sched_rpc_pending = true; continue; } + else if (match_tag(buf, "")) { + non_cpu_intensive = true; + continue; + } else if (match_tag(buf, "")) { suspended_via_gui = true; continue; @@ -173,6 +177,7 @@ void PROJECT::clear() { master_url_fetch_pending = false; sched_rpc_pending = false; tentative = false; + non_cpu_intensive = false; suspended_via_gui = false; dont_request_more_work = false; gui_urls.clear(); diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 48e1a97743..2a4324fab5 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -83,6 +83,7 @@ public: bool master_url_fetch_pending; // need to fetch and parse the master URL bool sched_rpc_pending; // contact scheduling server for preferences bool tentative; // master URL and account ID not confirmed + bool non_cpu_intensive; bool suspended_via_gui; bool dont_request_more_work;