Python multiprocessing.Queue 线程安全吗?

Is Python multiprocessing.Queue thread safe?

我有一个同时使用线程和进程的程序。为了在它们之间共享数据,我目前使用 multiprocessing.Queue。这个队列实现线程安全吗?

是的,是的。来自 https://docs.python.org/3/library/multiprocessing.html#exchanging-objects-between-processes:

Queues are thread and process safe.