[Twisted-Python] thread in reactor problem

Yan Zhu nayuhz at gmail.com
Tue Aug 7 23:58:25 EDT 2007

Hi all, I run a reactor in my thread, so I will get many connection by
twisted, and I run another thread for write back data to any connection.
But I've found the data is in buffer, not sent back immediately.  I traced
the twisted, found it blocked in class SelectReactor.doSelect():

while 1:
        r, w, ignored = _select(reads.keys(),
        [], timeout)
    ... ...
    #do sth

when the reactor is bloce by _select(), then my another thread modified the
*writes* dictionary, but _select could not know if writes.keys() is changed,
so when the thread want to write something, reactor won't do response. so,
the problem is above.

Is there any idea for this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070808/8c296909/attachment.htm 

More information about the Twisted-Python mailing list