Re: Inconsistent CPU usage
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 20:11:58 GMT
On Tue, 29 Apr 2008 13:44:53 -0700 (PDT), Elliot <eselick@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
while(!pW.isFinished){;}; // programmatic block to put up screen
This waits (by looping) for the boolean to be set to true while the
password is verified via the socket connection with Cobol.
That's a great way to chew up all the CPU time. Add a sleep in the
loop to avoid hammering the CPU.
See http://mindprod.com/jgloss/sleep.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- References:
- Inconsistent CPU usage
- From: Elliot
- Inconsistent CPU usage
- Prev by Date: Re: Questions about drawing on Canvas
- Next by Date: Re: Thread safety and atomic assignment (again)
- Previous by thread: Re: Inconsistent CPU usage
- Next by thread: Recommendation on Performance Monitoring Software
- Index(es):
Relevant Pages
|