Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2005 14:58:52 +0200
From:      "Norbert Koch" <NKoch@demig.de>
To:        <kamalp@acm.org>, "Peter Edwards" <peadar.edwards@gmail.com>, "Charles Sprickman" <spork@fasttrackmonkey.com>
Cc:        hackers@freebsd.org
Subject:   RE: Nagios and threads
Message-ID:  <000801c5772a$23dac9c0$4801a8c0@ws-ew-3.W2KDEMIG>
In-Reply-To: <20050622124007.75760.qmail@web52702.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> [snip] 
> > at least some assumptions that the child won't be
> > doing much before
> > execing or exiting. (But Im sure one of the
> 
> The child process should be able to call any system
> calls it likes -without assuming that pthreads from
> the parent process have been copied over to the child
> process. I spose most implementations support that.
> 
> regards
> -kamal

>From "Programming with POSIX Threads" [David R. Butenhof]:

p.197-198:
  ... Avoid using fork in a threaded program (if you can)
      unless you intend to exec a new program immediately
  ... Pthreads does not "terminate" the other threads
      in a forked process. ... They simple cease to exist.
  ... The state of mutexes is not affected by a fork. If
      it was locked in the parent it is locked in the child!


Norbert





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000801c5772a$23dac9c0$4801a8c0>