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-ArrivalTime: 1994-03-13 04:22:00 PST Xref: gmd.de comp.os.vms:42366 comp.sys.dec:14321 comp.unix.advocacy:1157 Path: gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!cs.utexas.edu!convex!news.utdallas.edu!mharriso From: mharriso@utdallas.edu (Mark A Harrison) Newsgroups: comp.os.vms,comp.sys.dec,comp.unix.advocacy Subject: Re: Does UNIX do async i/o? Followup-To: comp.os.vms,comp.sys.dec,comp.unix.advocacy Date: 13 Mar 1994 12:22:00 GMT Organization: The University of Texas at Dallas Distribution: world Message-ID: <2lv0h8$47t@news.utdallas.edu> References: <1994Feb26.204059.4068@mixcom.mixcom.com> <11MAR199400234346@hearts.aces.com> <1994Mar11.144337.13745@inmos.co.uk>,<1994Mar11.190110.20289@integrity.uucp> <2lqrtk$99p@gap.cco.caltech.edu>,<2lrev2$q4u@news.utdallas.edu> <2lrgl0$nav@gap.cco.caltech.edu>, <2lt8e4$ia2@genesis.ait.psu.edu> NNTP-Posting-Host: csclass.utdallas.edu X-Newsreader: TIN [version 1.2 PL2] Bryan J Jensen (bjj@ECLD.PSU.EDU) wrote: > Then I found I had to create some processes. UNIX requires the > parent process to do a "wait()" on the child process before it will > terminate a child. Since I can't wait around for processes to > finish, I need some mechanism to let me know when a process > terminates so that I can safely do the wait to complete its rundown. Try a SIGCHLD... details are in just about any unix programming book, if you can't find it in the man page. Here's a handy tip: grep can be used as a nice indexing tool in the man page directories. (flame protection -- It's also in the SUNOS master index, under both "process" and "termination"). Here's the relevant information: If the parent process of the calling process is executing a wait() or waitpid(), or is interested in the SIGCHLD signal, then it is notified of the calling process's termination and the low-order eight bits of status are made available to it (see wait(2V)). > Unfortunately, "select" may only be used to wait for certain types of > I/O to complete - it can't be used to wait for child process termination. > "wait" can be used to wait for any process to complete, but it can't > be used to wait for I/O to complete. That's because I/O and processes are two different things. > UNIX, on the other hand, patched async facilities in later, which seems > to be in keeping with the general haphazard nature of UNIX (that's > not really a criticism - diversity is politically correct these days). That's one of the reasons Unix has succeeded against all odds over the past 25 years. It adapts. (TCP/IP has had the same characteristics.) > I think the one thing that hurts most under VMS is that all system calls > return a status code. As a result, programmers feel obligated to test > for errors. Contrast that with UNIX where errors are rarely checked, > with the resulting frequent core dumps on null pointers. So it's > really just a tradeoff between developement time and reliability. This is a bit of an ad hominem: VMS returns error codes and VMS programmers feel obligated to check these codes, Unix returns error codes and Unix programmers rarely check error codes. Disclaimer: I'm so picky that I even check the return code from printf(). -- Mark Harrison mharriso@utdallas.edu mharriso@spd.dsccc.com