Path: utzoo!attcan!uunet!cs.utexas.edu!texbell!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.arch Subject: Re: Spawn is impossible to define (was Re: vfork) Message-ID: Date: 31 Jul 90 14:26:56 GMT References: <920@dgis.dtic.dla.mil> <5830@titcce.cc.titech.ac.jp> <5931@titcce.cc.titech.ac.jp> <1990Jul24.194313.3258@esegue.segue.boston.ma.us> <=VW4JSA@xds13.ferranti.com> <5962@titcce.cc.titech.ac.jp> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 38 In article <5962@titcce.cc.titech.ac.jp> mohta@necom830.cc.titech.ac.jp (Masataka Ohta) writes: > In article <=VW4JSA@xds13.ferranti.com> > peter@ficc.ferranti.com (Peter da Silva) writes: > >Well that case can be dealt with (parent catches and discards interrupts > >around the spawn call), but the reverse case creates a race condition. > Can be. But, it is too tricky for Average programmers. So, from my own observation of such code culled from the net, is signal handling and fork/exec in any case. > >This > >is not good, but it's also true that UNIX signals are *full* of such > >race conditions (hit ^C fast enough and you can blow away the shell). > That is untrue for BSD UNIX. That's using BSD's "reliable signales", which are an extension to standard UNIX signals. I'm sure that they also have the ability to solve the problem you originally posited. > >What is needed is a "defer signals" state, along with "default, catch, > >and ignore". This would solve this race condition, and also the one where > >the signal handler gets interrupted before resetting the signal. > OK. You want to intruduce a new (to SysV) state of a process. No, of a signal. A state that is also useful in that it solves the race conditions inherent in generic UNIX signals without adding the unwanted complexity of BSD's reliable signals system. KISS. > Then, how > can you set the defer/don't-defer state of a child process with spawn? You don't, because it's not meaningful any more than setting the catch/ don't catch state of a signal. Neither is useful without a signal handler, and that signal handler is sitting back in the parent process unavailable to the newly spawned/execed child. -- Peter da Silva. `-_-' +1 713 274 5180. 'U`