on-internet
← Community

Is Python's asyncio `loop.create_task(...)` threadsafe?

Stack Overflow ·

I have matplotlib running on the main thread with a live plot of data coming in from an external source. To handle the incoming data I have a simple UDP listener listening for packages using asyncio with the event loop running on a seperate thread. I now want to add more sources and I'd like to run their listeners on the same loop/thread as the first one. To do this I'm just passing the loop object to the classes implementing the listeners and their constructor adds a task to the loop that will initialize and run the listener. However since these classes are initialized in the main thread I'm

Comments

Sign in or sign up to comment and upvote.

No comments yet.