			Lock Server
			===========

  This directory contains the following files:

  lockserv.c : a simple lock server as described in the book
               "The Helios Parallel Operating System"

  locklib.c  : the library routines GetLock() and FreeLock(), as
               per the book

  locklib.h  : a header file defining the library interface

  locktest.c : a very basic test program for the library and server

  makefile   : to build the server, library, and test program

  readme     : this file

The Lock Server
===============

  The lock server can be built in two different ways. If compiled with the
DEBUG flag then it can run as an ordinary program. In particular it can
be run from the shell using the command line:
    lockserv &

Alternatively it could be run from the initrc file using:
    run -e /helios/local/lib/lockserv lockserv

or from a resource map using:
    processor SCSI { ~01, ~02, ~03, ~04; System;
			run -e /helios/local/lib/lockserv lockserv;
			...
    }

If compiled without the DEBUG flag then the server becomes a system
program that cannot be started from the shell, because it does not
accept an environment. It can still be started from the initrc file
or from the resource map.
    run /helios/local/lib/lockserv
or
    processor SCSI { ~01, ~02, ~03, ~04; System;
			run /helios/local/lib/lockserv;
	}

The server can be examined using, for example, "ls /lock". Any existing
locks will show up as files, and can be removed using e.g. "rm /lock/xyz".
None of the standard commands can be used to create locks, but it is
fairly easy to write such a command using the lock library.

To terminate the lock server, ensure that there are no outstanding
locks and then use the command "rm /lock".

lock.lib
========
	This scanned library contains the two routines GetLock() and
FreeLock(), as described in the book. The library is defined by the
header file locklib.h which should be included by any application using
the library. 
  GetLock() takes a single argument which should be a string of at most
31 characters, not containing any / characters. The meaning of this
string is application-specific. The routine returns NullLock on failure,
if a lock with that name already exists, or a Lock which can be passed
to FreeLock(). If there is an internal error, for example if the lock
server is not currently running, then the library will abort the current
program with an error message to the standard error stream.
  FreeLock() also takes a single argument which should be a Lock value
returned by a previous call to GetLock(). The routine does not return
a result.

locktest
========
	This is a simple test program to demonstrate the lock server and
library.

   
