Gabriel Genellina <[EMAIL PROTECTED]> writes:

> At Thursday 11/1/2007 03:43, Lloyd Zusman wrote:
>
>>   while threading.activeCount() > 1:
>>       time.sleep(0.001)
>>
>>   sys.exit(0)
>>
>>Is there any way to allow my program to respond to signals without
>>having to busy-wait in the main thread?
>
> Don't worry too much, this is *not* a busy wait, because you use
> sleep. You can use a longer sleep, it will be terminated by any
> signal. But not too long, or the check for activeCount() will be delayed
> in excess. (I use sleep(1) usually but your needs may be different)

Well, if this is the best that we can currently do in python, then so be
it.

My sincere thanks.


-- 
 Lloyd Zusman
 [EMAIL PROTECTED]
 God bless you.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to