How to configure thread in C # just for execution when CPU is inactive?

I have a windows service in C #. I want a specific thread to perform certain actions, but only when the CPU is inactive. Is there any way to do this in C #.

+3
source share
2 answers

You can let the OS handle it for you as follows:

Thread thread = Thread.CurrentThread;
thread.Priority = ThreadPriority.Lowest;
+6
source

Try setting ThreadPriority to LowNormal or less. See MSDN .

+2
source

Source: https://habr.com/ru/post/1715591/


All Articles