[Twisted-Python] Re: Twisted-Python Digest, Vol 45, Issue 18

glyph at divmod.com glyph at divmod.com
Sun Dec 16 03:13:08 MST 2007


On 10:04 am, josef.robert.novak at gmail.com wrote:
>Ok I see this will definitely not work as we are talking about threads 
>and
>not processes so os.kill is of no use to me.  I guess there is no way 
>to
>track these new threads and stop/pause/restart them based on some other
>decision logic?  Would have been nice if there were though...  -joe

If you really think about it (and I mean really think about it, computer 
science-y stuff, understanding what sharing state in threads really 
means, how the Python interpreter happens to work now, considering all 
the ways it could work) the idea of stopping and restarting threads is 
inherently broken.  You might be able to make it work, by accident, for 
a few simple cases, but there would be no reasonable way to guarantee 
safety except for forcing the explicit use of channels to communicate 
between threads.  If you're doing that, though, you're effectively using 
processes. SIGSTOP and friends work just fine on them :).




More information about the Twisted-Python mailing list