[Logo]
Forums Register Login
How do you change the priority range for threads?
Say I want a thread priority range between 0-127 with a lower number meaning a higher priority. How would I simulate that?
In a word, you can't. The fact is the Thread priority constants are implementation dependent, so a priority of 1, 2, and 3 may be identical on Windows and distint on Solaris.
You could try to come up with an algorithm that would have each thread yield and sleep based on your arbitrary numbering but the behavior would not be consistent in all probability. The big problem with threads is you are at the mercy of the OS that creates and schedules the threads.
Moving this to the Threads and Synchronization forum...
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 24, 2017 22:30:50.