Skip to content
Advertisement

Tag: multiprocessing

Share RLock between multiple instances of Python with multiprocessing

Consider this MWE: When this script is executed, it instantiates the_setup and serves it. Then I want clients to be able to do things like this from other scripts: However, I get RuntimeError: RLock objects should only be shared between processes through inheritance. If the with the_setup.hold_hardware(): is removed, it works fine but then I cannot guarantee that the hardware

Python: will a thread ever unblock while hanging on a `Queue.get(block=True)` call if the queue is suddenly destroyed from another thread/process?

TLDR: Would a blocking get be unblocked by a queue that would be terminated in some way? Long question: Okay, so I know that the thread will hang if the queue (multiprocessing.Queue) remains empty forever while trying to fetch something from it with a blocking get. But suppose now that in another thread or process, I close the queue with

Advertisement