From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 22 14:24:11 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2762316A41C for ; Wed, 22 Jun 2005 14:24:11 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id E53F343D53 for ; Wed, 22 Jun 2005 14:24:10 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id 13so284364nzp for ; Wed, 22 Jun 2005 07:24:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SnEYcgUciwbKLsvEsSqXY6Y20zjYVQwE0/TQ+4eUcTOuoAfW7BSi/N+rPlt7irW26TwdmV0XOQLguwAT6YaByymu+CQW3QyuaCF8JoitUkEiDNaq0bMR7q98tKuwXoLUNPOFxKsHN3Yb6P25a0rHCGOhYFvghvdCI2PawHyfmz0= Received: by 10.36.222.2 with SMTP id u2mr588615nzg; Wed, 22 Jun 2005 07:24:07 -0700 (PDT) Received: by 10.36.68.15 with HTTP; Wed, 22 Jun 2005 07:24:07 -0700 (PDT) Message-ID: <34cb7c8405062207246b582eaf@mail.gmail.com> Date: Wed, 22 Jun 2005 15:24:07 +0100 From: Peter Edwards To: kamalp@acm.org In-Reply-To: <20050622124007.75760.qmail@web52702.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <34cb7c840506210750f7458cf@mail.gmail.com> <20050622124007.75760.qmail@web52702.mail.yahoo.com> Cc: Charles Sprickman , hackers@freebsd.org Subject: Re: Nagios and threads X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 14:24:11 -0000 On 6/22/05, Kamal R. Prasad wrote: > [snip] > > at least some assumptions that the child won't be > > doing much before > > execing or exiting. (But Im sure one of the >=20 > 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. >=20 There's more to it than system calls, though (most (all?) of which will be async-signal-safe anyway). Simple example: any lock that the libc implementation needs to provide its functionality may be arbitrarily locked by some other thread: eg, one thread calls malloc() as another calls fork(): the original thread ceases to exist in the child while holding a lock in malloc, leaving malloc() unusable in the process. It may be that FreeBSD is less tolerant of this than other OSes, and the failure may occur more frequently, but I'm not sure that there's anything wrong with it per se.