On 05/03/2009, at 6:53 PM, Kamil Gorlo wrote: > I want to start another thread T1 in my Pylons App (manually, not > Paste#http worker) and have some global dict which all http workers > will read. But T1 periodically will update this dictionary (in fact > all he want to do is to swap this global dict with local dict which > was prepared during his work). In this dict I will have Python > primitives (other dicts too) and simple classes which act only as > 'structs'. Do I need lock?
If unsure I'd suggest use a lock. What are you saving by skipping the lock? If the dict swap happens infrequently then the lock will be insignificant. You also need to ensure that modifications to any of the objects that the dict points to are protected by locks. Cheers, Chris Miles --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
