This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asynchat problems multi-threaded
Type: enhancement Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, dmaurer
Priority: normal Keywords:

Created on 2002-08-14 19:34 by dmaurer, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
asynchat.pat dmaurer, 2002-08-14 19:34 patch for "asynchat.push"
Messages (2)
msg11972 - (view) Author: Dieter Maurer (dmaurer) Date: 2002-08-14 19:34
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. 
msg11973 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2003-03-10 15:39
Logged In: YES 
user_id=11375

Added to PEP 42 and closed; this would be a fair bit of work, 
and it's not clear many people use asynchat.
History
Date User Action Args
2022-04-10 16:05:35adminsetgithub: 37033
2002-08-14 19:34:06dmaurercreate