小编Yan*_*ick的帖子

如何在Python中的多个线程和进程之间有效地共享数据?

我有一个主线程Cmd从运行cmd2threading.Thread()这使我能够使用“实时”执行模拟来交互地启动新线程。每个时间步的模拟结果是put() in a multiprocessing.Queue(). Additionally I can start live plots using matplotlib.animate. I read matplotlib is not thread-safe, so the plots run as a multiprocessing.Process() and get() the simulation results from the queue.

Unfortunately, once items from the queue are collected, they are deleted from the queue and not available for other threads or processes. This means I can send data from the simulation threads to the plotting processes, but can't …

python multithreading multiprocessing

6
推荐指数
1
解决办法
2653
查看次数

标签 统计

multiprocessing ×1

multithreading ×1

python ×1