From e7270c7f9669cd3fcda45076833ca050623fd158 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 17 Dec 2008 00:49:50 +0000 Subject: [PATCH] - API: add "normal_thread_priority" to BOINC_OPTIONS. If set, the worker thread runs at normal priority on Win. May be useful for CUDA apps. svn path=/trunk/boinc/; revision=16705 --- api/boinc_api.cpp | 8 +++++--- api/boinc_api.h | 4 ++++ checkin_notes | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/api/boinc_api.cpp b/api/boinc_api.cpp index fbdc18a432..d81fbb5396 100644 --- a/api/boinc_api.cpp +++ b/api/boinc_api.cpp @@ -989,9 +989,11 @@ int start_timer_thread() { return errno; } - // lower our (worker thread) priority - // - SetThreadPriority(worker_thread_handle, THREAD_PRIORITY_IDLE); + if (!options.normal_thread_priority) { + // lower our (worker thread) priority + // + SetThreadPriority(worker_thread_handle, THREAD_PRIORITY_IDLE); + } #else pthread_attr_t thread_attrs; pthread_attr_init(&thread_attrs); diff --git a/api/boinc_api.h b/api/boinc_api.h index 31f57d1768..6f23021a65 100644 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -53,6 +53,9 @@ typedef struct BOINC_OPTIONS { int backwards_compatible_graphics; // V6 apps should set this so that "Show Graphics" will work // with pre-V6 clients + int normal_thread_priority; + // run app at normal thread priority on Win. + // (default is idle priority) } BOINC_OPTIONS; typedef struct BOINC_STATUS { @@ -145,6 +148,7 @@ inline void boinc_options_defaults(BOINC_OPTIONS& b) { b.direct_process_action = 1; b.worker_thread_stack_size = 0; b.backwards_compatible_graphics = 1; + b.normal_thread_priority = 0; } diff --git a/checkin_notes b/checkin_notes index efb249d9c3..d12fe41890 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10180,3 +10180,11 @@ David 16 Dec 2008 db_conn.inc ops/ autolock.php + +David 16 Dec 2008 + - API: add "normal_thread_priority" to BOINC_OPTIONS. + If set, the worker thread runs at normal priority on Win. + May be useful for CUDA apps. + + api/ + boinc_api.cpp,h