Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site boring.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxr!ulysses!allegra!mit-eddie!godot!harvard!seismo!mcvax!boring!jack From: jack@boring.UUCP Newsgroups: net.unix-wizards,net.sources Subject: Re: When does ( alarm(1) == alarm(INFINITY) ) ? Message-ID: <6358@boring.UUCP> Date: Fri, 15-Mar-85 08:53:36 EST Article-I.D.: boring.6358 Posted: Fri Mar 15 08:53:36 1985 Date-Received: Sun, 17-Mar-85 00:37:38 EST References: <132@heurikon.UUCP> <1094@calgary.UUCP> <1095@calgary.UUCP> <1097@calgary.UUCP> <178@encore.UUCP> <179@encore.UUCP> Reply-To: jack@boring.UUCP (Jack Jansen) Organization: CWI, Amsterdam Lines: 23 Xref: watmath net.unix-wizards:12455 net.sources:2718 Summary: Apparently-To: rnews@mcvax.LOCAL In article <179@encore.UUCP> ptw@encore.UUCP (P. Tucker Withington) writes: >As I read the manual (I didn't read the code) pause will only return when a >signal is "caught". If the semantics were that it would also return >(immediately) if there were no signal handlers active (since they revert when >caught), the race condition would also disappear. This sounds nice at first, but gives rise to some even weirder situations. For instance, I have a program that uses this feature, and then, later on, decide to put an interrupt handler in it, in case the user wishes to abort the program. Guess what? Suddenly my program stops working!! I wouldn't want to look for *that* bug........ An other approach would be to let pause() return if there is no signal handler for SIGALRM, but I'm sure that there are people who use pause() for things totally unrelated to alarm() calls. By the way, I *do* agree that it might not be a bad idea to have pause() return when there are no signal handlers installed, but I think it is not a complete solution to this race condition. -- Jack Jansen, {decvax|philabs|seismo}!mcvax!jack It's wrong to wish on space hardware.