-
-
Notifications
You must be signed in to change notification settings - Fork 991
Linux thread priority/nice set to lower-priority than normal starting from the second benchmark. #2706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The process and thread priority is set here. BenchmarkDotNet/src/BenchmarkDotNet/Toolchains/InProcess/NoEmit/InProcessNoEmitExecutor.cs Lines 94 to 95 in 6ce9795
They are set to highest (just under realtime). They are set for each benchmark, so I'm not sure why you are observing different behavior between benchmarks. Are you actually reading the value before the first benchmark? |
It is halfway running the benchmark. I use htop (like windows task manager) to monitor the processes and threads. The first row is the process and the second row is the thread. |
My guess is thread.TrySetPriority(ThreadPriority.Highest, parameters.Logger); fails as linux prevents a thread to be more prioritized than the process, and the enums of thread.Priority don't map exactly to the NICE levels of linux. Thus, when the |
Priority = ... seems to be a no-op on nativeaot on linux. I'm not sure how it happens now. |
I am aware of this behavior; but it is still weird that the thread's priority becomes lower than normal priority. |
I agree that is strange. Unfortunately I don't know how to debug it. |
The text was updated successfully, but these errors were encountered: