update python variable in each child?

34 views
Skip to first unread message

SDQL

unread,
May 22, 2012, 12:42:59 AM5/22/12
to Tornado Web Server
Hi,

Is it possible to update python data in each child process?

Let's say I have a python list of cities

cities = ['Atlanta','Boston',...]

and I want to allow web clients to append this list.

I can easily do this in one process: is it possible to do this in each
of the child processes?

Thanks,

Joe

A. Jesse Jiryu Davis

unread,
May 22, 2012, 1:26:52 AM5/22/12
to python-...@googlegroups.com
In theory, if one parent process spawns all the children, it could use facilities in the multiprocessing module to share data among them:

http://docs.python.org/library/multiprocessing.html

However, I'd strongly recommend using a database to store shared data.
Reply all
Reply to author
Forward
0 new messages