Re: How to run tasks with priority?
- From: "George George via JavaKB.com" <forum@xxxxxxxxxx>
- Date: Thu, 09 Jun 2005 09:32:37 GMT
Thanks Boudewijn,
Boudewijn Dijkstra wrote:
>> Thanks Boudewijn,
>>
>[quoted text clipped - 10 lines]
>> to verify that the difference behavior of yield method and sleep method. Do
>> you have any good ideas?
>
>Make a thread that increments a variable as fast as it can. After every
>increment it calls an abstract myWait() method that waits a number of
>milliseconds. One implementation loops yield() until it reaches the wait
>time. The other implementation simply calls sleep(long).
>
I am wondering whether your testing method will work. Since if there is
only one thread in the system, yield will have no effect. But in your
description, there are only one thread. Our testing purpose is to verify
that yield method will idle CPU (if there are more than one threads running)
, while sleep will not idle CPU.
Maybe it is my mis-understanding of your description. It is highly
appreciated if you could write down your ideas into sample source codes.
regards,
George
--
Message posted via http://www.javakb.com
.
- Follow-Ups:
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- References:
- Re: How to run tasks with priority?
- From: George George via JavaKB.com
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- From: George George via JavaKB.com
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- From: George George via JavaKB.com
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- From: George George via JavaKB.com
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- From: George George via JavaKB.com
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- From: George George via JavaKB.com
- Re: How to run tasks with priority?
- From: Boudewijn Dijkstra
- Re: How to run tasks with priority?
- Prev by Date: Re: Question about clone a Hashtable
- Next by Date: Re: Coming to java from C++: multiple inheritance
- Previous by thread: Re: How to run tasks with priority?
- Next by thread: Re: How to run tasks with priority?
- Index(es):