Re: Recommendations on Locking/SharedMem/IPC modules

[email protected] (Stephen Adkins)
Newsgroups perl.p5ee
Message-ID <[email protected]>
FYI.

I have added Resource Locking and Shared Storage to my components list.

   http://www.officevision.com/pub/p5ee/components.html#locking

Resource Locking

IPC::Locker - uses a lock daemon (lockerd, included) to 
              do network-wide unique resource locking
IPC::Semaphore (IPC::SysV) - uses System V Unix semaphores

Shared Storage

IPC::MM - interface to Ralf Engelschall's libmm library (cross-platform 
          shared mem), can "tie" multiple scalars and hashes into the 
          shared mem segment, locking available for the entire segment
DBI - can store a multi-level hash in a table if you serialize first
MLDBM (MLDBM+BerkeleyDB, MLDBM+GDBM) - store multi-level hash in a DBM 
          using Storable
MLDBM::Sync - same as MLDBM but with locking
IPC::Shareable - allows a tied var in shared mem, 1 var per shared mem 
          segment!, some locking, depends in SysV IPC
IPC::ShareLite - store()/fetch in shared mem, 1 var per shared mem 
          segment!, some locking, depends in SysV IPC
Cache::Mmap
Cache::Cache (Cache::FileCache, Cache::SharedMemoryCache)

If any others of you have additional suggestions, send them in and I'll
add them.

Stephen

At 03:38 PM 3/12/2002 -0500, Perrin Harkins wrote:
>Stephen Adkins wrote:
>> I am looking for recommendations for modules which handle
>> cooperative resource locking across processes (similar to
>> semaphores in Unix).
>
>The kind of locking you're talking about may not be implemented 
>conveniently in the same modules that do data sharing well.  For 
>example, Cache::Cache has no separate locking interface since it uses 
>atomic renaming instead.
>
>> "Cooperative" is in contrast to something like "flock"
>> where the operating system knows about the resource being
>> locked and can actually enforce the locking.
>
>Hmmm.  I thought flock was strictly voluntary.  The OS knows about it, 
>but does nothing to enforce it.  You have to write your code to ask for 
>permission to change a file by attempting to flock it yourself.
>
>I'm working on an article that will cover the best options for data 
>sharing, but I don't have hard data yet.  There was a thread about this 
>on the mod_perl list with some basic benchmark numbers.  It starts here:
>http://groups.yahoo.com/group/modperl/message/39954
>
>The best performers were IPC::MM and Cache::Mmap.
>
>If you decide to go with Cache::Cache, you may want to use the internal 
>modules Cache::FileBackend or Cache::SharedMemoryBackend, because they 
>give better performance when you just need shared data and don't need 
>the cache interface.
>
>- Perrin
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.