[issue26371] asynchat.async_chat and asyncore.dispatcher_with_send are not thread-safe

2016-02-17 Thread NGG
NGG added the comment: "Why not using asyncio instead of having to rebuild your own implementation?" The issue happened with python 2.7 and we don't want that project to depend on additional libraries. I think we will upgrade that project to python3 soon and will probably us

[issue26371] asynchat.async_chat and asyncore.dispatcher_with_send are not thread-safe

2016-02-17 Thread NGG
NGG added the comment: If I want to write a TCP client which communicates back and forth with the server (both parties can send messages anytime) then it would be really easy to use it the following way: Start a background thread with asyncore.loop(), and you can send messages easily, and

[issue26371] asynchat.async_chat and asyncore.dispatcher_with_send are not thread-safe

2016-02-16 Thread NGG
New submission from NGG: The initiate_send() method in both asynchat.async_chat and asyncore.dispatcher_with_send is not a thread-safe function, but it can be called from multiple threads. For example if asyncore.loop() runs in a background thread, and the main thread sends a message then