Skip to content Skip to sidebar Skip to footer

How To Combine Multiprocessing And Eventlet

I have a task need to start 2 processes and within each process need to start 2 threads to do really work. Below is the source code I used to simulate my use case. import multiproc

Solution 1:

As of 2018-01, Eventlet and multiprocessing don't work well together. Your best option is to spawn worker processes externally. Second best option is os.fork() to create worker processes and only thenimport eventlet.

Subscribe to this issue to be notified when multiprocessing compatibility is resolved. https://github.com/eventlet/eventlet/issues/147

Solution 2:

The main module should be importable for multiple process to work properly. Do not call main() in global space, use it like:

if name == 'main': main()

Post a Comment for "How To Combine Multiprocessing And Eventlet"