<bh*************@gmail.comescribió:
HelloUse a Queue object to communicate between threads. The language itself
I have a thread updating a dictionary with new elements. How can I check
for
new elements as they are inserted into the dictionary by the thread? In
general is it safe to read a dictionary or a list while it is being
updated
by a running thread? Does the dictionary or list have to be locked while
reading?
many questions! :)
doesn't guarantee anything about atomicity.
You might put the new elements in a queue, and make the consumer update
the dictionary instead of the producer.
--
Gabriel Genellina