Index by title

Installing IPC::Locker

Download

Download from CPAN/wsnyder.

Prerequisites

IPC::Locker should run on any operating system with Perl, though it is only been tested on Linux.

Installation

If you're using a recent version of Perl, just:

cpan install IPC::Locker

Otherwise, untar, make, test, and install manually: cd IPC-Locker-* perl Makefile.PL make make test make install

tar xvzf IPC-Locker*.t*gz

Usage

After installation, see the kit's README, and notes on installing the lockerd and pidstatd daemons.


Introduction to IPC::Locker

Written by Wilson Snyder <wsnyder@wsnyder.org>.

Summary

IPC::Locker provides cross-cluster locking. This lets you insure only one copy of a critical section of code executes simultaneously across all machines in a network cluster.

This is useful for protecting make jobs, or to insure a CAD tool is only invoked when a license is available for that tool.

Also included is the ability to detect if a process ID is still executing on a remote host, and a program to kill a process with another process on a remote host exits. This allows multiprocessor simulation jobs to be killed when a master process exits.

Example

Example perl code to insure only one "critical section" is in the cluster: my $lock = IPC::Locker->new(lock=>'my_lock_name')->lock; print "Only one perl program across the cluster will print this at a time...\n"; $lock->unlock;

use IPC::Locker;

Alternatively, you can place a lock around any program, such as one requiring a license:

lockersh --lock license-for-tool  my-cad-tool {arguments}

See also

See the buttons at the top of this page, which include:

IPC::Locker installation