Subject: Re: fork(2) vs. pthread_create() (fwd)
To: Martin Husemann <email@example.com>
From: Emmanuel Dreyfus <firstname.lastname@example.org>
Date: 06/09/2004 08:43:40
On Wed, Jun 09, 2004 at 10:40:59AM +0200, Martin Husemann wrote:
> On Wed, Jun 09, 2004 at 08:34:48AM +0000, Emmanuel Dreyfus wrote:
> > 3) We fork
> > 4) We spawn many threads
> > Given that
> > the program violates no standard, I'd just call it a bug in NetBSD native
> > libpthread.
> According to Nathans explanation it does violate Posix: you can not do (4)
> because you did not exec and the pthread_* functions needed for step 4
> are not async signal safe.
Before forking, I joined the exisiting thread, thus reverting to a single
threaded process. The problem is that the process remebers it has been
threaded when I hit the fork, whereas it is not threaded anymore.