我有一个同时使用线程和进程的程序。为了在它们之间共享数据,我目前使用 multiprocessing.Queue
。这个队列实现线程安全吗?
最佳答案
是,是的。来自 https://docs.python.org/3/library/multiprocessing.html#exchanging-objects-between-processes :
Queues are thread and process safe.
关于python - Python multiprocessing.Queue 线程安全吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34936948/