Reputation: 1
I am writing a program where all threads will be in execution and In middle of the execution I should be able to change priority and this change should take place immediately.(I have changed lower priority thread to higher)and next higher should execute first.Will this work
Upvotes: 0
Views: 128
Reputation: 156
Java provides no guarantee that high priority thread will get executed before low priority. High priority thread will get more of a CPU time, but that doesn't mean the low priority thread will wait until the high priority thread is finished. To summarize, the order of execution of threads will be random, regardless of priority.
Upvotes: 1