Gevent monkeypatching breaking multiprocessing

前端 未结 5 509
無奈伤痛
無奈伤痛 2020-12-05 04:55

I am attempting to use multiprocessing\'s pool to run a group of processes, each of which will run a gevent pool of greenlets. The reason for this is that there is a lot of

5条回答
  •  借酒劲吻你
    2020-12-05 05:37

    If you will use original Queue, then you code will work normally even with monkey patched socket.

    import multiprocessing
    
    from gevent import monkey
    monkey.patch_all(thread=False)
    
    q= multiprocessing.Queue()
    

提交回复
热议问题