[mod_python] Using shared memory to do global persistence

Jonathan Gardner jgardner at jonathangardner.net
Thu Jun 26 11:45:57 EST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 26 June 2003 11:36, Greg Stein wrote:
> APR has facilities to do shared memory in a portable fashion; APR is part
> of Apache 2.0, so there isn't much reason to go grab any other library.
>
> You can also use APRUTIL's apr_rmm.h to manage sub-allocations within the
> shared memory segments. The problem is that a shared memory segment could
> be mapped to different addresses in different processes. Thus, you want to
> hold onto offsets into a shared memory segment. apr_rmm.h helps with
> managing these subblocks and working with offsets rather than direct
> pointers. Note that apr_rmm also handles locking so that you can have
> multiple processes allocating (simultaneously) from a shared mem segment.
>
> You can then layer additional Python facilities on top of this substrate.
>

The python facility would be something like POSH.

So, based on this new information, the project scope would now become:

1) Expand POSH so that it can use shared objects that were shared by a foreign 
process (provided with some information on which shared memory segment they 
are using)

2) Integrate POSH with mod_python and APR.

The problem I see now: How to communicate between all of the processes that 
there are shared objects available, and detail where those shared objects 
are? I don't think it is possible to create shared objects via mod_python 
before the processes are seperated. Even if it was, is it possible to 
transfer references to those shared objects to each process?

The only solution I see right now is to have some central repository that any 
process can access and declare the existence of shared objects, their 
location, and whatever else is needed. Other processes can read the 
repository and find currently existing shared objects by a unique string.

The exact nature of the repository isn't important. It could be a bit of 
shared memory in a special location, a file, a Berkely DB, or even something 
more exotic. The point is that the processes can declare new shares, or find 
existing shares by a unique identifier.

- -- 
Jonathan Gardner <jgardner at jonathangardner.net>
(was jgardn at alumni.washington.edu)
Live Free, Use Linux!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE++z9mWgwF3QvpWNwRAmawAKDDzpi9kOyIu88CZaCxVTsCqYQ1uwCgymzr
n6NkA9YggvsuqJcdzmnzpdc=
=rHuV
-----END PGP SIGNATURE-----



More information about the Mod_python mailing list