Re: Inconsistent CPU usage



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
.



Relevant Pages

  • Re: [patch] CFS scheduler, -v19
    ... Ingo Molnar wrote: ... I dont yet understand the failure mode though that results in that looping and in the 30% CPU time use - do you understand it perhaps? ... Can't say, I have automount running because I get it by default, but I have nothing using at on my test machine. ...
    (Linux-Kernel)
  • Re: CONTAINS from a list
    ... Rather than looping through them all I wanted to try and see whether I can do ... This allows the input search values to be joined against the table without ... > Boolean OR. ... > Here is an example of such a query: ...
    (microsoft.public.sqlserver.fulltext)