Communicating between threads

suggest change

There are multiple threads in your code and you need to safely communicate between them.

You can use a Queue from the queue library.

Creating producer and consumer threads with a shared queue

q = Queue()
t1 = Thread(target=consumer, args=(q,))
t2 = Thread(target=producer, args=(q,))
t1.start()
t2.start()

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents