TypeError: can't pickle _thread.lock objects

前端 未结 3 1587
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 20:15

Trying to run two different functions at the same time with shared queue and get an error...how can I run two functions at the same time with a shared queue? This is Python

3条回答
  •  不知归路
    2020-12-02 20:38

    You need to change from queue import Queue to from multiprocessing import Queue.

    The root reason is the former Queue is designed for threading module Queue while the latter is for multiprocessing.Process module.

    For details, you can read some source code or contact me!

提交回复
热议问题