On Jan 6, 2007, at 1:46 PM, Stefan wrote:
So the question is, what does your app have that the default app
doesn't? Do you have threads that are running in the background? Do
you have lots of socket communications? Timers?
I need to check the exact situation.
But let's rephrase my question:
Suppose I have a worker thread, which need to perform a certain job
n seconds (n > 5) after
the end of the current job. If I don't want to use a timer to kick
of the next run,
I would ordinarily Suspend() the Thread. Would this make the app go
idle? Or is RB still
busy idling each few millis to see, if the Thread has Resume()d?
What's the best practice, to really release the CPU for a known time
of n idle seconds?
You can call Sleep if you'd like. Either Suspend or Resume should do
it for you. If you know how long you're going to sleep for, Sleep is
much easier than trying to Suspend then Resume. In any event, when a
thread is suspended, it is removed from the list of potential threads,
which means when we calculate how long we can yield to the system, we
should tell it we can yield forever.
However, there may be a bug that you're running into. What version are
you using? As of r4 (IIRC, maybe 2007r1) we fixed a bug in which the
app would eat up a lot more CPU than necessary when all the threads
were sleeping on OS X.
HTH,
Jon
--
Jonathan Johnson
[EMAIL PROTECTED]
REAL Software, Inc.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>