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
set_current_thread_priority(get_current_thread_priority)
seems to fail
#25
Comments
Hi @matteomonti! Thank you for opening an issue here. To better help you with that issue, can you please specify what platform did you run your example on? |
Hello there @vityafx :) I am running on a 64-bit server, x86 architecture, Intel Xeon processor, running Ubuntu 20.04.5 LTS (Focal Fossa). If you have any other question, I am at your disposal! |
@matteomonti I have found the reason for this problem. Let me explain it here so that I don't forget this myself, and, perhaps, it might be of interest for you as well. This has appeared quite recently after the changes I made for the realtime threads support and I have an idea how to solve this for such a simple case: just get the current thread policy and map the P.S. All the text in italics is an incorrect code made on a wrong assumption, perhaps, before I made use of |
I have made some changes there, now it should be accounting for the current thread's scheduling policy. This way you should be able to reset the same thread priority. |
@matteomonti Can you please share when you will be able to verify the fix works for you? |
I've decided to try out
thread_priority
for my project and started by trying out the most simple example:Sadly, the example panics with an
Error::PriorityNotInRange(1..=99)
(current
is logged to beThreadPriority::CrossPlatform(0)
). I am wondering ifThreadPriority::CrossPlatform(0)
stands for something like "cannot retrieve priority"? I would naively imagine the default priority of a thread to hover somewhere around50
, rather than at (actually, below) the lowest possible value.The text was updated successfully, but these errors were encountered: