Re: How to run tasks with priority?



"George George via JavaKB.com" <forum@xxxxxxxxxx> schreef in bericht
news:ccbe4cc6a6a0411a813b5d5ab3fbd444@xxxxxxxxxxxxx
> Thanks Boudewijn,
>
>
> Boudewijn Dijkstra wrote:
>>[quoted text clipped - 3 lines]
>>>
>>> Do you mean using yield method will idle the CPU?
>>
>>No. I said that with yield, there wasn't a chance of actually idling the
>>CPU >>(as long as there are other threads ready).
>
> Sorry that I do not express myself very clearly. I mean yield method will
> 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.


.



Relevant Pages

  • Re: How to run tasks with priority?
    ... Boudewijn Dijkstra wrote: ... Do you mean using yield method will idle the CPU? ... know how to write a simple program to test that sleep method will not idle ...
    (comp.lang.java.help)
  • Re: How to run tasks with priority?
    ... Boudewijn Dijkstra wrote: ... >> make current thread idle on CPU ... >> and it will give chances to other threads to run on CPU. ... to verify that the difference behavior of yield method and sleep method. ...
    (comp.lang.java.help)
  • Re: How to run tasks with priority?
    ... >> Do you mean using yield method will idle the CPU? ... there wasn't a chance of actually idling the CPU ...
    (comp.lang.java.help)
  • Re: [RFC] (How to) Let idle CPUs sleep
    ... turns out that if we restrict the amount of time idle cpus are ... cpu sleeps. ... * local timer ticks. ... +int idle_balance_retry ...
    (Linux-Kernel)
  • Too many timer interrupts in NO_HZ
    ... CPU in an SMP server. ... However I am interested to see CPU idle times for couple minutes on ... There are way too many timer interrupts even though the CPUs have ... entered tickless idle loop. ...
    (Linux-Kernel)