From dddb7e8ff3f3ede400203bf7b1454398d39c84c6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 19 Jan 2005 21:53:46 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5145 --- checkin_notes | 11 +++++++++++ client/client_state.C | 45 +++++++++++++++++++++++++------------------ client/client_state.h | 2 +- client/cs_prefs.C | 10 ++++------ doc/acct_mgt.php | 14 +++++++------- doc/configuration.php | 6 ++++++ 6 files changed, 55 insertions(+), 33 deletions(-) diff --git a/checkin_notes b/checkin_notes index ada397b576..5b703d293f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -22962,3 +22962,14 @@ David 19 Jan 2005 html/inc/ profile.inc uotd.inc + +David 19 Jan 2005 + - Change the logic in CLIENT_STATE::do_something to + avoid unsuspending activities before starting them + - change CLIENT_STATE::check_suspend_activities() from int to void + + Checked these changes into boinc_public also + + client/ + client_state.C,h + cs_prefs.C diff --git a/client/client_state.C b/client/client_state.C index 7e2aa13335..0399a1e2c1 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -343,7 +343,7 @@ int CLIENT_STATE::net_sleep(double x) { // (in which case should call this again immediately) // bool CLIENT_STATE::do_something(double now) { - int actions = 0, reason, retval; + int actions = 0, suspend_reason, retval; SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_POLL); static bool tasks_restarted = false; @@ -352,23 +352,38 @@ bool CLIENT_STATE::do_something(double now) { start_cpu_benchmarks(); } - retval = check_suspend_activities(now, reason); - if (!retval) { - if (reason) { + check_suspend_activities(now, suspend_reason); + + // Restart tasks on startup. + // Do this here (rather than CLIENT_STATE::init()) + // so that if we do benchmark on startup, + // we don't immediately suspend apps + // (this fixes a CPDN problem where quitting the app + // right after start kills it) + // + if (!suspend_reason && !tasks_restarted) { + restart_tasks(); + tasks_restarted = true; + } + + // suspend or resume activities (but only if already did startup) + // + if (tasks_restarted) { + if (suspend_reason) { if (!activities_suspended) { - suspend_activities(reason); + suspend_activities(suspend_reason); } } else { if (activities_suspended) { resume_activities(); } } - activities_suspended = (reason != 0); + activities_suspended = (suspend_reason != 0); } // if we're doing CPU benchmarks, don't do much else // - if (reason & SUSPEND_REASON_BENCHMARKS) { + if (suspend_reason & SUSPEND_REASON_BENCHMARKS) { // wait for applications to become suspended // if (active_tasks.is_task_executing()) { @@ -379,17 +394,17 @@ bool CLIENT_STATE::do_something(double now) { return gui_rpcs.poll(dtime()); } - check_suspend_network(now, reason); - if (reason) { + check_suspend_network(now, suspend_reason); + if (suspend_reason) { if (!network_suspended) { - suspend_network(reason); + suspend_network(suspend_reason); } } else { if (network_suspended) { resume_network(); } } - network_suspended = (reason != 0); + network_suspended = (suspend_reason != 0); scope_messages.printf("CLIENT_STATE::do_something(): Begin poll:\n"); ++scope_messages; @@ -404,14 +419,6 @@ bool CLIENT_STATE::do_something(double now) { // in that order (active_tasks_poll() sets must_schedule_cpus, // and handle_finished_apps() must be done before schedule_cpus() - // restart tasks here so that if we do benchmark on startup, - // we don't immediately suspend apps - // - if (!activities_suspended && !tasks_restarted) { - restart_tasks(); - tasks_restarted = true; - } - ss_logic.poll(); if (activities_suspended) { scope_messages.printf("CLIENT_STATE::do_something(): activities suspended\n"); diff --git a/client/client_state.h b/client/client_state.h index 861b1bf63f..815c9148da 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -244,7 +244,7 @@ public: int allowed_disk_usage(double&); int allowed_project_disk_usage(double&); private: - int check_suspend_activities(double, int&); + void check_suspend_activities(double, int&); int suspend_activities(int reason); int resume_activities(); void check_suspend_network(double, int&); diff --git a/client/cs_prefs.C b/client/cs_prefs.C index 0ea12c2db6..6c692b9f48 100644 --- a/client/cs_prefs.C +++ b/client/cs_prefs.C @@ -131,7 +131,7 @@ inline bool now_between_two_hours(int start_hour, int end_hour) { // See if (on the basis of user run request and prefs) // we should suspend activities. // -int CLIENT_STATE::check_suspend_activities(double now, int& reason) { +void CLIENT_STATE::check_suspend_activities(double now, int& reason) { static double last_time = 0; reason = 0; @@ -141,14 +141,14 @@ int CLIENT_STATE::check_suspend_activities(double now, int& reason) { reason |= SUSPEND_REASON_BENCHMARKS; } - if (user_run_request == USER_RUN_REQUEST_ALWAYS) return 0; + if (user_run_request == USER_RUN_REQUEST_ALWAYS) return; if (user_run_request == USER_RUN_REQUEST_NEVER) { reason |= SUSPEND_REASON_USER_REQ; - return 0; + return; } - if (now - last_time < 5.0) return 1; + if (now - last_time < 5.0) return; last_time = now; if (!global_prefs.run_on_batteries @@ -168,8 +168,6 @@ int CLIENT_STATE::check_suspend_activities(double now, int& reason) { if (!now_between_two_hours(global_prefs.start_hour, global_prefs.end_hour)) { reason |= SUSPEND_REASON_TIME_OF_DAY; } - - return 0; } int CLIENT_STATE::suspend_activities(int reason) { diff --git a/doc/acct_mgt.php b/doc/acct_mgt.php index 690eea13a5..915428e709 100644 --- a/doc/acct_mgt.php +++ b/doc/acct_mgt.php @@ -20,18 +20,18 @@ and then for each selected project:

-If the user chooses N projects, +If the participant chooses N projects, there are N forms to fill out, N emails to handle, and N dialog interactions with the BOINC client. This is tedious if there are lots of projects. Furthermore, it involves cutting and pasting long random strings, -which is intimidating to some users. +which is intimidating to some participants.

This document describes BOINC's support for account management systems, which streamline the process of finding and joining BOINC projects. A typical account management system is implemented as a web site. -The user experience is: +The participant experience is: