Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site dartvax.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!dartvax!chuck
From: chuck@dartvax.UUCP (Chuck Simmons)
Newsgroups: net.arch
Subject: Re: RMS v/s UNIX (non-religious)
Message-ID: <2799@dartvax.UUCP>
Date: Sun, 3-Mar-85 23:35:47 EST
Article-I.D.: dartvax.2799
Posted: Sun Mar  3 23:35:47 1985
Date-Received: Wed, 6-Mar-85 03:14:49 EST
References: <917@sjuvax.UUCP> <538@rlgvax.UUCP>
Organization: Dartmouth College, Hanover, NH
Lines: 39

> VMS, on the other hand, has a locking mechanism that locks magic cookies;
> cooperating applications agree on a name for a resource and they lock
> that name when they want to lock that resource.
> ...
> This means you can lock things other than files; perhaps locking should
> have nothing to do with the file system.
> 
> 	Guy Harris

(in my opinion) Locking should have a lot to do with the file system.
As a miniumum, by default if one process has a file open with write 
permission no other process should be able to read or write that file.
(This is just one example.)  This protects naive users (like myself)
from trashing themself or being trashed by others.

Interestingly (?), this default locking mechanism implemented by the
operating system which the user/programmer does not need to worry
about provides a simple-minded "magic cookie" locking mechanism.  The
cooperating applications simply agree on the name of a file.  To lock
the magic cookie, a process opens the file with all permissions.  To
unlock the magic cookie, the process closes the file.  No doubt, it
would be nice to have some sort of queuing mechanism as well, however.

Naturally, two processes should be able to override the default
locking mechanism.  For example when you have a database that needs to
be accessed by many users at the same time.  But it is important that
a programmer not need to put any thought into having exclusive access
to a file when he is expecting only one process to access that file.
It is alright if a programmer needs to think a little more when she
wants to use a shared file.

You mentioned "N-level heirarchies".  What are these?  Where would you
use them?  Could you describe some sample applications that use nifty
and easy to use locking mechanisms?  Our system is pretty simple-minded
(but much better than Unix), and so my education is lacking.

Thanks, chuck_simmons%dcts1@dartvax