Re: How to run tasks with priority?
- From: "George George via JavaKB.com" <forum@xxxxxxxxxx>
- Date: Fri, 10 Jun 2005 03:30:32 GMT
Thanks Boudewijn,
Boudewijn Dijkstra wrote:
>> Thanks Boudewijn,
>>
>[quoted text clipped - 12 lines]
>> I am wondering whether your testing method will work. Since if there is
>> only one thread in the system, yield will have no effect.
>
>In this case "no effect" means that it will continue running, i.e. not
>sleeping.
>
>> But in your
>> description, there are only one thread. Our testing purpose is to verify
>[quoted text clipped - 3 lines]
>> Maybe it is my mis-understanding of your description. It is highly
>> appreciated if you could write down your ideas into sample source codes.
>
>Agreed, but only because I became curious myself. ;)
>Running the following test application should be accompanied by a CPU-usage
>monitor program. First it will do a yield-test for 10 seconds, then it will
>do a sleep-test for 10 seconds. Observe the difference in CPU usage. The
>getFinalScore method doesn't really serve any purpose, besides maybe the
>calculation of (TEST_TIME / WAIT_TIME).
>
Your sample program is great! You mentioned that I should use CPU monitor
program. So I have tried and used performance monitor of task manager of
Windows XP (invoked from "My Computer") to monitor CPU usage. Am I correct?
I have found that when yield is running, the CPU usage is very high, and
when sleep is running, te CPU usage is very slow. Do you know why when
running yield, CPU usage is high? What is CPU busy doing at that time (in
my mind, I think CPU has nothing to do when running yield, just as when
running sleep)?
Another small issue is that, why you use join method in your getFinalScore
method? I have not seen its special functons yet.
Have a nice weekend,
George
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200506/1
.
- 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?
- 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: Remote Development
- Next by Date: OutOfMemoryError but java.hprof.txt is normal
- Previous by thread: Re: How to run tasks with priority?
- Next by thread: Re: How to run tasks with priority?
- Index(es):
Relevant Pages
|