client: add config option to not lower client priority

We added code a couple of months ago to lower client priority:
on Win, this is SetPriorityClass(),
which lowers I/O and memory priority as well as CPU.
This has the desired effect, i.e. to reduce the performance impact
of BOINC when it's doing things like copying large files.
However, it means that BOINC can take a long time to start at boot,
which may be disconcerting to some users.
This commit is contained in:
David Anderson 2015-11-11 10:33:24 -08:00
parent 9fbd4bd4da
commit 3c8ceb028d
4 changed files with 12 additions and 1 deletions

View File

@ -460,7 +460,9 @@ int CLIENT_STATE::init() {
msg_printf(NULL, MSG_INFO, "Libraries: %s", curl_version());
if (!cc_config.dont_lower_client_priority) {
set_client_priority();
}
if (executing_as_daemon) {
#ifdef _WIN32

View File

@ -188,6 +188,9 @@ void CC_CONFIG::show() {
if (dont_check_file_sizes) {
msg_printf(NULL, MSG_INFO, "Config: don't check file sizes");
}
if (dont_lower_client_priority) {
msg_printf(NULL, MSG_INFO, "Config: don't lower client priority");
}
if (dont_suspend_nci) {
msg_printf(NULL, MSG_INFO, "Config: don't suspend NCI tasks");
}
@ -346,6 +349,7 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) {
if (xp.parse_bool("disallow_attach", disallow_attach)) continue;
if (xp.parse_bool("dont_check_file_sizes", dont_check_file_sizes)) continue;
if (xp.parse_bool("dont_contact_ref_site", dont_contact_ref_site)) continue;
if (xp.parse_bool("dont_lower_client_priority", dont_lower_client_priority)) continue;
if (xp.parse_bool("dont_suspend_nci", dont_suspend_nci)) continue;
if (xp.parse_bool("dont_use_vbox", dont_use_vbox)) continue;
if (xp.match_tag("exclude_gpu")) {

View File

@ -208,6 +208,7 @@ void CC_CONFIG::defaults() {
disallow_attach = false;
dont_check_file_sizes = false;
dont_contact_ref_site = false;
dont_lower_client_priority = false;
dont_suspend_nci = false;
dont_use_vbox = false;
exclude_gpus.clear();
@ -341,6 +342,7 @@ int CC_CONFIG::parse_options(XML_PARSER& xp) {
if (xp.parse_bool("disallow_attach", disallow_attach)) continue;
if (xp.parse_bool("dont_check_file_sizes", dont_check_file_sizes)) continue;
if (xp.parse_bool("dont_contact_ref_site", dont_contact_ref_site)) continue;
if (xp.parse_bool("dont_lower_client_priority", dont_lower_client_priority)) continue;
if (xp.parse_bool("dont_suspend_nci", dont_suspend_nci)) continue;
if (xp.parse_bool("dont_use_vbox", dont_use_vbox)) continue;
if (xp.match_tag("exclude_gpu")) {
@ -547,11 +549,13 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) {
" <disallow_attach>%d</disallow_attach>\n"
" <dont_check_file_sizes>%d</dont_check_file_sizes>\n"
" <dont_contact_ref_site>%d</dont_contact_ref_site>\n"
" <dont_lower_client_priority>%d</lower_client_priority>\n"
" <dont_suspend_nci>%d</dont_suspend_nci>\n"
" <dont_use_vbox>%d</dont_use_vbox>\n",
disallow_attach,
dont_check_file_sizes,
dont_contact_ref_site,
dont_lower_client_priority,
dont_suspend_nci,
dont_use_vbox
);

View File

@ -149,6 +149,7 @@ struct CC_CONFIG {
bool disallow_attach;
bool dont_check_file_sizes;
bool dont_contact_ref_site;
bool dont_lower_client_priority;
bool dont_suspend_nci;
bool dont_use_vbox;
std::vector<EXCLUDE_GPU> exclude_gpus;