[Tutor] threading: getting latest elements from list/dict

bob gailer bgailer at gmail.com
Mon May 5 13:33:46 CEST 2008


Vaibhav.bhawsar wrote:
> Hello
> 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?

http://www.python.org/doc/faq/library/#what-kinds-of-global-value-mutation-are-thread-safe


-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



More information about the Tutor mailing list