Reputation: 24008
there. I don't even know if this question makes sense, however: how do BOINC-based applications adapt their performance so that they only use "free" CPU, without affecting the execution of user's applications?
Thank you,
Tunnuz
Upvotes: 0
Views: 178
Reputation: 7778
They set their process priority to the same as the idle thread?
In windows SetPriorityClass() about IDLE_PRIORITY_CLASS:
Process whose threads run only when the system is idle. The threads of the process are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle-priority class is inherited by child processes.
More about scheduling priorities in windows here
Upvotes: 2
Reputation: 73161
Most likely they just set the priority of their computation thread(s) to something very low, and then rely on the OS's scheduler to do the rest. Threads/processes with a low priority will only run when no other threads need the CPU time for anything.
Upvotes: 1