[Chicago-talk] Sharing data between processes

Greg Fast gdf at speakeasy.net
Wed Jan 21 13:39:56 CST 2004


On Wed, 21 Jan 2004 09:12:36 -0600, "Jay Strauss" <me at heyjay.com> wrote:
> What ways can I share an object (or complex data structure) between
> processes?  I know I can share simple structures (arrays, hashes, scalars)
> between threads, but I was trying to avoid threads.

IPC::ShareLite is pretty easy to use, assuming you're running on a box
with sysv ipc (generally, not windows).  Using ShareLite would involve
storing/serializing the object to a location where another process can
retrieve it, so it's still not "sharing" in the sense of two processes
concurrently accessing a single object.

If you can't use IPC, you can mimic this by, for example, using
Storable and writing files to a directory (or pipe, or whatever).
Locking/concurrent access issues become a real potential problem,
naturally.

I don't know if anyone's ever written a solid RPC/RMI-type utility for
Perl (maybe PlRPC?).


--
Greg Fast
http://cken.chi.groogroo.com/~gdf/



More information about the Chicago-talk mailing list