tomasbedrich
tomasbedrich

Reputation: 1370

Is Python multiprocessing.Queue thread safe?

I have a program which uses both, threads and processes. To share a data between them, I currently use a multiprocessing.Queue. Is this queue implementation thread safe?

Upvotes: 10

Views: 11094

Answers (1)

tomasbedrich
tomasbedrich

Reputation: 1370

Yes, it is. From https://docs.python.org/3/library/multiprocessing.html#exchanging-objects-between-processes:

Queues are thread and process safe.

Upvotes: 14

Related Questions