Subject: Re: SMP problems in fork()?
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 12/09/2002 10:20:31
On Sun, Dec 08, 2002 at 11:36:22PM +0200, Antti Kantee wrote:
> On Sun Dec 08 2002 at 21:19:29 +0000, David Laight wrote:
> > Consider also the case of fork with both FORK_PPWAIT and FORK_NOWAIT
> > set (ie vfork with the parent set to initproc).
> >
> > The process priorities could be such that:
> > if (flags & FORK_PPWAIT)
> > while (p2->p_flag & P_PPWAIT)
> > tsleep(p1, PWAIT, "ppwait", 0);
> >
> > accesses p2->p_flag after the child has been reaped - even on
> > a single cpu system.
>
> vfork with nowait doesn't make much sense. Besides, there's nothing that
> calls fork1() with both set, and I can't imagine why there ever would be.
How about forking in order to exec a daemon?
David
--
David Laight: david@l8s.co.uk