문제

I'm wondering why does .NET only offer 5 thread priorities (i.e. highest, aboveNormal, etc.) to choose from if Windows OS uses 32 priorities?

도움이 되었습니까?

해결책

Windows uses the process priority together with the thread priority to calculate the overall priority. Once you know that, you can google for process priorities and perhaps you find Scheduling Priorities on MSDN.

I would highly appreciate if you could read the book Windows Internals 6th edition, part 1, which describes it in detail on page 410++.

In C# you can try

using System.Diagnostics;
using System.Threading;
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.AboveNormal;
Thread.CurrentThread.Priority = ThreadPriority.Highest;

and look at the results with ProcessExplorer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top