[net.lang.c] Record Locking

cottrell@NBS-VMS.ARPA (COTTRELL, JAMES) (02/19/86)

/*
Dagwynn once lamented the absence of record locking in BSD:
> If I had it, I'd sure use it.  (RECORD locking more than FILE locking.)
> Living on a 4.2BSD kernel, I have no record locking at all (my System V
> emulation obviously can't compensate adequately for this lack).  

Allow me to propose a kluge. Since on can create lockfiles of any
name, create a parrallel directory /whatever/lock, and create lock
files of the form `name#number' in that directory. Thus to lock
record three of file `foo' create a lock /whatever/lock/foo#3'.
Multi-record lox are more difficult, but can be done with a little
head scratching. Yeah, it ain't pretty, but it just might work.

> Since record locking is a recent addition, it is not surprising that 
> previous existing utilities don't use it; that proves nothing about its 
> possible future importance.

Most assuredly.

	jim		cottrell@nbs
*/

------

bzs@bu-cs.UUCP (Barry Shein) (02/20/86)

>From: cottrell@NBS-VMS.ARPA (COTTRELL, JAMES)
>Allow me to propose a kluge. Since on can create lockfiles of any
>name, create a parrallel directory /whatever/lock, and create lock
>files of the form `name#number' in that directory. Thus to lock
>record three of file `foo' create a lock /whatever/lock/foo#3'.
>Multi-record lox are more difficult, but can be done with a little
>head scratching. Yeah, it ain't pretty, but it just might work.

I have a better idea. Being as 4.2bsd can have up to 256 characters
in a file name and that most data-bases can live with less than 256
characters in a record (or a multiple, fixed record scheme can be
used, or even variable) why not just store the data in the file names
and leave the files empty (or fill them with change info or something.)
You can then use all those file searching things (like wildcards and
'find') as data-base queries, you can do 'record' locking etc etc.
Touch becomes the data-entry program, rm for removing, built in dates
of creation, modification, access, ownership kept in the inode, guaranteed
synchronous write-through on update, atomicity of record creation...

I know, shut up Barry, you've lost your mind again....

	-Barry Shein, Boston University