UNIX semantics do permit full support for asynchronous I/O

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Sat Sep 1 06:10:55 AEST 1990


In article <1990Aug30.222226.20866 at cbnewsm.att.com> lfd at cbnewsm.att.com (leland.f.derbenwick) writes:
> In article <27619 at nuchat.UUCP>, steve at nuchat.UUCP (Steve Nuchia) writes:
> > Have read(2) and write(2) calls map the pages containing the buffers
> > out of the user address space and return immediately.  Once the
> > data have been copied (DMAed?) to/from the buffers, map the pages back in.
> Apart from the implementation problems that others have mentioned,
> _this suggestion breaks existing code_.

No, it does not. On many paged machines, an implementation of Steve's
suggestion takes virtually [sic] no time. The worst that happens is your
original efficiency. The best that happens is a noticeable speedup,
especially of pipe read-writes. A program that uses, say, a getpage()
call to allocate a page-aligned buffer can guarantee the best case.

> In essentially any serious database application, a completed
> write() to a raw disk is treated as a guarantee that the data
> block has been _physically written to the device_.

No. Any database application that claims to recover after crashes
without fsync()ing its write()s is lying. (This says some interesting
things about certain System V database programs.)

---Dan



More information about the Comp.unix.wizards mailing list