Python线程,如何实现共享队列?
我正在使用python模块“螺纹”来异步和以thread> threadlock.release()
and thread> thread> threadlock.release()以排队方式运行一个任务。
这个问题是我正在运行相同的python程序,例如4-5台计算机和正在运行的异步任务,可以更改对同一Google表文件以及Dropbox等上的其他一些文件,因此如果同时使用了2台或更多台计算机,则可能会导致问题,因为事情被覆盖。
我喜欢现在在每台计算机上本地运行的情况,但是我只需要一种方法来获取threadlock.release()
and threadlock.release()
即可与其他运行相同Python程序的计算机基本上是计算机之间的共享队列。我缺少的螺纹模块中可能有一个简单的修复程序吗?
I'm using the Python module "Threading" to run a task in my code asynchronously and in a queued manner with threadLock.release()
and threadLock.release()
.
The issue IS that i am running the same python program on like 4-5 computers and the asynchronous task that is being run makes changes to the same google sheet file and also some other files on dropbox etc, so if 2 or more of the computers are being used at the same time, it can cause issues because things get overwritten.
I love how things are running now locally on each computer, but I just need a way to get the threadLock.release()
and threadLock.release()
to communicate with the other computers running the same python program, basically a shared queue between computers. Is there possibly a simple fix in the threading module that i am missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论