Updating a modul leve shared dictionary
Posted
by Vishal
on Stack Overflow
See other posts from Stack Overflow
or by Vishal
Published on 2010-06-16T01:09:36Z
Indexed on
2010/06/16
1:12 UTC
Read the original article
Hit count: 195
python
Hi,
A module level dictionary 'd' and is accessed by different threads/requests in a django web application. I need to update 'd' every minute with a new data and the process takes about 5 seconds.
What could be best solution where I want the users to get either the old value or the new value of d and nothing in between.
I can think of a solution where a temp dictionary is constructed with a new data and assigned to 'd' but not sure how this works!
Appreciate your ideas.
Thanks
© Stack Overflow or respective owner