According to the MSDN documentation regarding SetThreadPriority:
"Sets the priority value for the specified thread. This value, together
with the priority class of the thread's process, determines the thread's
base priority level."

To make sure that GPU apps get access to the CPU when required but still
run in the background, the Collatz apps use the following for Windows
versions:

if (SetPriorityClass(GetCurrentProcess(),BELOW_NORMAL_PRIORITY_CLASS))
  SetThreadPriority(worker_thread_handle, THREAD_PRIORITY_BELOW_NORMAL);

I believe that boinc_init only allows idle or normal priority.Using the
above allows the GPU apps to run at a higher priority than the CPU apps
which is especially good when there are 8.5 cores (e.g. 8 CPU workunits and
1 GPU workunit @ 0.5 CPUs) allocated on an 8 core host.

Jon Sonntag



On Sun, Sep 27, 2015 at 12:18 AM, David Anderson <[email protected]>
wrote:

> Windows has an API for reducing the priority of I/O and memory usage,
> namely SetPriorityClass():
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms686219(v=vs.85).aspx
> with the PROCESS_MODE_BACKGROUND_BEGIN**arg.
>
> However - inexplicably - this arg can be used only by a process on itself,
> not another process.
> So we could call this from boinc_init() on Win, but it wouldn't work with
> existing apps.
> *
> *
> On 9/26/2015 2:13 AM, Christian Beer wrote:
>
>>
>> The main question here is: Is there a way to prioritize Memory and I/O
>> access? If yes is it available on all platforms (Windows, Mac, Linux)? If
>> not, is there a general way to get the load information from and schedule
>> accordingly?
>>
>> You would still have to distinguish between BOINC generated Memory and
>> I/O operations and from other apps. This seems very tricky.
>>
>> —
>> Reply to this email directly or view it on GitHub <
>> https://github.com/BOINC/boinc/issues/1392#issuecomment-143414260>.
>>
>>
> _______________________________________________
> boinc_dev mailing list
> [email protected]
> http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
> To unsubscribe, visit the above URL and
> (near bottom of page) enter your email address.
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to