ali0806 / Video_Streaming_With_ML

0 stars 0 forks source link

I am facing a deadlock error while working with multiprocessing. #1

Open ali0806 opened 1 year ago

ali0806 commented 1 year ago

It raise a error in _wait_for_tstate_lock if lock.acquire(block, timeout)

ali0806 commented 1 year ago

To solve this problem, concepts like this can be used.

According to the second warning box in the documentation you are linking to you can get a deadlock when you join a process before processing all items in the queue. So starting the process and immediately joining it and then processing the items in the queue is the wrong order of steps. You have to start the process, then receive the items, and then only when all items are received you can call the join method. Define some sentinel value to signal that the process is finished sending data through the queue