From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 24 15:27:33 2005 Return-Path: X-Original-To: freebsd-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 1B67D16A41F; Wed, 24 Aug 2005 15:27:33 +0000 (GMT) (envelope-from babkin@verizon.net) Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id D420043D5C; Wed, 24 Aug 2005 15:27:32 +0000 (GMT) (envelope-from babkin@verizon.net) Received: from vms069.mailsrvcs.net ([192.168.1.2]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0ILQ00943G9W5280@vms042.mailsrvcs.net>; Wed, 24 Aug 2005 10:27:32 -0500 (CDT) Date: Wed, 24 Aug 2005 10:27:32 -0500 (CDT) From: Sergey Babkin To: Jeremie Le Hen , Warner Losh Message-id: <13362915.1124897252422.JavaMail.root@vms069.mailsrvcs.net> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailman-Approved-At: Thu, 25 Aug 2005 11:44:22 +0000 Cc: deischen@FreeBSD.org, freebsd-hackers@FreeBSD.org, lists@nbux.com Subject: Re: Re: nagios and freebsd threads issue : help please ... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: babkin@users.sf.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2005 15:27:33 -0000 >> > This is funny, because nagios apparently runs properly on Linux, HPUX, >> > Solaris, Irix, AIX and Tru64. To me that seems to indicate that Nagios This does not neccessary mean that it _really_ works. There might be a race involved that usually ends up lucky on these systems. >> > is very portable indeed and that the BSD fellows somehow botched it. I >> > might be wrong, but... >> >> Just because it works doesn't make it standards conforming. >> >> Maybe there's some simple extension that can be implemented to help >> the situation. > >It seems the main problem of the Nagios developper seems to be they >would need to rewrite a big part of their current implementation. >I'm not sure however this is mandatory. I wonder if the so-told >pthread_atfork() handler wouldn't be a quick solution to address the >problem. Sorry if it's dumb. I'd even say that it's the proper correct solution. This probably should me made a part of "how to write thread-safe libraries": register pthread_atfork() function that would free every possible mutex and conditional in the library. And clean up the other state too. -SB