Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ncar!midway!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: UNIX semantics do permit full support for asynchronous I/O Message-ID: <26331@mimsy.umd.edu> Date: 1 Sep 90 22:10:56 GMT References: <60345@lanl.gov> <27619@nuchat.UUCP> <1990Sep1.185221.8718@eng.umd.edu> Distribution: usa Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 30 >In article <1990Aug30.222226.20866@cbnewsm.att.com> lfd@cbnewsm.att.com (leland.f.derbenwick) writes: >>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_. ... In article <1990Sep1.185221.8718@eng.umd.edu> stripes@eng.umd.edu (Joshua Osborne) writes: >Unix guarantees no such thing. If you want it you need to use >fsync(filno), or open the file in sync mode. Currently Unix copys >data to write into it's disk buffers, .... Look again: he said `raw disk'. Raw I/O calls physio; physio calls vslock (in 4BSD anyway); vslock pages in and locks in core all the memory needed for the transfer; physio calls physstrat or the device strategy routine (depending on the partiuclar variant of 4BSD); physstrat (if it exists) calls the device strategy routine; the device routine queues the transfer and, if necessary, starts the device, then returns; and then physio/physstrat *WAITS*. Finally, physio calls vsunlock (which may also mark the pages as modified) and returns. It would be useful to be able to start raw transfers without waiting. I once (actually, twice) wrote a driver that did this. Sort of a hack, but it worked. It required changes to vsunlock() (to allow it to be called at interrupt time) and exit() (to avoid throwing away the process VM until the device close routines finished up). It would be better to do this more directly, though. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris