[Python-bugs-list] [ python-Bugs-595217 ] asynchat problems multi-threaded

noreply@sourceforge.net noreply@sourceforge.net
Wed, 14 Aug 2002 12:34:06 -0700


Bugs item #595217, was opened at 2002-08-14 19:34
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595217&group_id=5470

Category: Python Library
Group: Python 2.1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Dieter Maurer (dmaurer)
Assigned to: Nobody/Anonymous (nobody)
Summary: asynchat problems multi-threaded

Initial Comment:
asynchat.async_chat.push has two problems when
used in an application where the pusher and the
main loop are run by different threads.

1.  A "push" does not wake up the main loop. This may 
result in long delays (the loop, by default, uses a timeout 
of 30 s). The work around is an explicit wakeup on the 
loop. I do not have a solution for Windows (more 
generally an OS where select does not work for pipes).
When select does work for pipes, a simple "wakeup"
can be implemented by writing to a pipe the main loop
is waiting for.

2. The "self.initiate_send" can lead to two identical
sends (which should be only one!) under the condition
above. Workaround is to remove the call. 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595217&group_id=5470