[Twisted-Python] Threading WIth Twisted

John Abel john.abel at pa.press.net
Wed Oct 23 08:32:21 EDT 2002


Hi,

I am in the process of adding the option to compress logfiles, to 
twisted.python.logfile.  So that Twisted doesn't come to a standstill 
whilst compress a large file, I made the compress function run in a 
seperate thread.  However, if the file takes longer than a couple of 
seconds to compress, and rotate is called again, another thread is 
launched.  This thread, attempts to write to the same file as the 
initial thread.  I've had a look at the code, but I can't seem to find a 
provision within Twisted, to queue the threads.  Is there a way to do 
this, or, should I be looking at something else?

This only ever occurs, when the log rotation is set to occur very 
frequently, (i.e. every couple of seconds, or every 100 bytes), but I'd 
rather fix it, than impose limits on the frequency of log rotation.

Thanks

John





More information about the Twisted-Python mailing list