Re: How to run tasks with priority?



Thanks Boudewijn,


Boudewijn Dijkstra wrote:
>> Thanks Boudewijn,
>>
>[quoted text clipped - 8 lines]
>> make current thread idle on CPU (current thread will not occupy CPU time)
>> and it will give chances to other threads to run on CPU. Am I correct?
>
>That is correct. But yield will have no effect if the current thread is the
>only 'ready' one with the same priority.
>

Your reply is very helpful! I am wondering how can I write a simple program
to verify that the difference behavior of yield method and sleep method. Do
you have any good ideas?


regards,
George

--
Message posted via http://www.javakb.com
.



Relevant Pages