[net.unix-wizar] mutual exclusion between process

hickman (01/10/83)

#R:we13:-35900:zinfandel:12400008:000:706
zinfandel!hickman    Jan  8 16:14:00 1983

You clearly do not understand the real problem behind locking.  Access is
fine, in that it will correctly tell any program if a file exists or not.
But using access and then using creat is not a single operation, but two,
which means the locking can fail.

If for example, two process's were running simultaneously down the same piece
of code, they both would get the correct information from access(), and both
of them would then, in their opinion, correctly, perform a creat().


Thus, for proper locking to be done, it must be done through a system call
which is "atomic".

creat() is atomic, so is link().  creat() won't work for root, but link()
will.....

Hope this helped some...
						kipp hickman