Path: utzoo!attcan!uunet!munnari!basser!boyd
From: boyd@basser.oz (Boyd Roberts)
Newsgroups: comp.unix.wizards
Subject: Re: Is write(2) "atomic" ?
Message-ID: <1310@basser.oz>
Date: 14 Jul 88 07:09:22 GMT
References: <11410005@eecs.nwu.edu> <23801@bu-cs.BU.EDU>
Reply-To: boyd@basser.oz (Boyd Roberts)
Organization: Dept of Comp Sci, Uni of Sydney, Australia
Lines: 39

Ok guys, enough is enough.  Regular file writes are atomic,
courtesy of plock().  Pipe writes are atomic, courtesy of
plock(), provided the size of the write is less than the
MAXIMUM size (not the available size) of the data that
can be held in the pipe.

Directory _writes_ (yes, it's a side affect of namei())
are atomic, courtesy of plock().

Character special writes are ``atomic'' on cblock boundaries
for tty style devices.  That is, not truly atomic.

Sockets, ether-packets, etc _should_ be atomic in the expected way.
Read your protocol _spec_ right now!!

Stream writes (from memory... my memory, not RAM) should
be atomic due to allocb() allocating a large enough block
to contain the data.   A bit like pipes, really.

Block special writes are atomic on block boundaries.  You
are _supposed_ to do ``block'' transfers.

Yes, there are races, but there are atomic writes.

A word of warning, do not reply or post anything containing
any of the following ``words'':

	   NFS
	   RFS
	   POSIX
	   X/OPEN

We are discussing UNIX file system semantics.


Boyd Roberts			boyd@basser.cs.su.oz
				boyd@necisa.necisa.oz

``When the going gets wierd, the weird turn pro...''