NAME
munchies_lock - Provide set/reset locking semantics
SYNOPSIS
- munchies_lock -c list
-
List the contents of the lock table
- munchies_lock -c reset -k key
-
Reset the lock for key
- munchies_lock -c set -k key -p pid [-t timeout]
-
Set the lock for key. Caller must provide it's PID. Timeout defaults to five minutes
- munchies_lock -H|-h
-
Display man page/usage string
VERSION
0.4.$Rev: 1267 $
DESCRIPTION
This program exposes the subroutines in the IPC::SRLock module
Use one of three mechanisms to provide set/reset locking semantics. On Unix systems where the SysV IPC works use semaphores and shared memory. On Cygwin use flock(3m). There is also an implementation using libmemcached
Perl's portable flock(3m) mechanism to single thread access to the lock table. The lock table is a text file in XML format. Successful lock setting results in a line entry being written to the lock table. Other processes wishing to set the lock will suspend until the lock is released or times out. When released or timed out the line entry is removed from the lock table. The key can be any string (no commas), the pid should be the PID of the lock setting process, i.e. ${$} in Shell. The timeout defaults to five minutes.
REQUIRED ARGUMENTS
OPTIONS
DIAGNOSTICS
Prints errors to stderr
EXIT STATUS
Returns zero on success, non zero on failure
CONFIGURATION
Uses the constructor's appclass attribute to locate a configuration file
Locking mechanisms are selected in the OS dependant configuration file. Setting lock_type in the global config to ipc selects the SysV IPC method.
INCOMPATIBILITIES
None
DEPENDENCIES
BUGS AND LIMITATIONS
Send reports to Support at RoxSoft.co.uk
AUTHOR
Peter Flanigan
LICENSE AND COPYRIGHT
Copyright (c) 2009 Peter Flanigan
This is free software; you can redistribute it and/or modify it under the same terms as Perl itself.