Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpsal2!hpcupt1!davel From: davel@hpcupt1.HP.COM (Dave Lennert) Newsgroups: comp.unix.questions Subject: Re: msleep Message-ID: <6060001@hpcupt1.HP.COM> Date: Mon, 16-Nov-87 23:26:24 EST Article-I.D.: hpcupt1.6060001 Posted: Mon Nov 16 23:26:24 1987 Date-Received: Thu, 19-Nov-87 23:49:50 EST References: <332@PT.CS.CMU.EDU> Organization: Hewlett Packard, Cupertino Lines: 21 > 2) using setitimer is more expensive than calling select with three > `(fd_set *)0' arguments. Select does have one problem: like > sigpause, it is interrupted by signals; unlike sigpause, it does > not take a signal mask, so it sometimes has unavoidable critical > sections. (Yes, I want a sixth argument to select!) > -- > In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) > Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris > ---------- In reality one would like every system call to accept a signal mask (like what sigpause() does for pause()). However, it is not impossible to code reliably; setjmp()...longjmp() work acceptably. You can't code reliably in the presense of signals (especially SIGALRM) without using setjmp()...longjmp() (with the one exception of sigpause()). If you timeout a system call other than sigpause() by arming SIGALRM and then immediately invoking the system call (without setjmp()) you have a race condition. -Dave Lennert HP ihnp4!hplabs!hpda!davel