From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,47a06d19e281eb8d X-Google-Attributes: gidf7344,public X-Google-Thread: 111731,47a06d19e281eb8d X-Google-Attributes: gid111731,public X-Google-Thread: 1164f8,47a06d19e281eb8d X-Google-Attributes: gid1164f8,public X-Google-Thread: f6134,47a06d19e281eb8d X-Google-Attributes: gidf6134,public X-Google-ArrivalTime: 1994-03-14 11:40:54 PST Xref: gmd.de comp.org.decus:3030 comp.os.vms:42449 comp.sys.dec:14377 comp.unix.advocacy:1206 Newsgroups: comp.org.decus,comp.os.vms,comp.sys.dec,comp.unix.advocacy Path: gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!library.ucla.edu!ihnp4.ucsd.edu!swrinde!menudo.uh.edu!uuneo.NeoSoft.com!jabberwock!daniels From: daniels@biles.com (Brad Daniels) Subject: Re: Does UNIX do async i/o? References: <1994Feb26.204059.4068@mixcom.mixcom.com> <1994Mar11.190110.20289@integrity.uucp> <1994Mar12.184813.513@rlgsc.com> Organization: Biles and Associates Date: Mon, 14 Mar 1994 19:40:54 GMT Message-ID: In article <1994Mar12.184813.513@rlgsc.com>, wrote: ... >The point of asynchronous event is situations where you have >multiple simultaneous activities proceeding. For example, >consider a process which has an outstanding terminal IO, a >network link to manage, and a real-time device to control. The >sequence of event completions (and possible exceptions) on the >different devices is unpredictable. On OpenVMS, the best way to >implement this is through the $QIO system service, using AST >routines to receive control when each particular operation >complete (alternatively, one could use DECthreads to implement >the same functionality). I haven't really been following this whole flame fest, but the new topic caught my attention. Forgive me if I misunderstand the capabilitiy being requested here. POSIX does provide non-blocking I/O. You can set a file to be non-blocking using fcntl with an O_NONBLOCK parameter. You can also set it to send your process a SIGIO signal when I/O completes. You can also use select() with any file to determine whether a read or write would block. The only thing which is tough to implement is the equivalent of a read completion AST. However, on systems which support POSIX threads, the effect of a read completion AST can be achieved much more easily by using blocking I/O in another thread. On OSF/1, this approach is very efficient, while on some other platforms, it is usually actually implemented using select(). - Brad ------------------------------------------------------------------------ + Brad Daniels | "Let others praise ancient times; + + Biles and Associates | I am glad I was born in these." + + These are my views, not B&A's | - Ovid (43 B.C. - 17 A.D.) + ------------------------------------------------------------------------