Design question - Sharing of single object by multiple processes
42flicks at gmail.com
Thu Jan 31 06:07:40 CET 2008
Hello, I've just picked up the Python language and am really enjoying it.
I've just signed up to this mailing list and I'm looking forward to taking
part in some discussions.
My first post is a question I've been pondering for the last couple of days:
For relatively static data (such as a list), is it possible to load a single
instance and have many python processes access it?
I want to have an object in memory. This object will be loaded on
application start up and will contain a list of objects. These will be
obtained from (most likely) the file system.
My reasoning is: I want to prevent a file system or database fetch each time
as it seems unnecessary.
Is this possible? In Java I'm pretty sure this could implemented with an
object factory and static methods. My understanding is that python invokes a
separate process for each request however.
If possible, what would be a good way of providing a new structure as it is
If anyone could give me some advice or point me in the correct direction I'd
really appreciate it.
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list