From owner-freebsd-current@FreeBSD.ORG Thu Sep 18 14:02:23 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23DB9106566C for ; Thu, 18 Sep 2008 14:02:23 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id A2FCC8FC20 for ; Thu, 18 Sep 2008 14:02:22 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: by ey-out-2122.google.com with SMTP id 6so1480112eyi.7 for ; Thu, 18 Sep 2008 07:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer; bh=kkd/piepp2sZYUW2DzI775zBANPYY1dbLu8PTtFmvLI=; b=rVbF2r+3VqwxRl/GBBhmJVPrPLyWI7dT33YtxAZWV9aNGfJnNw89FBagySa0pbEcQU lB+feMO6bVqa1uSyj1lObwi2ewj83G4hRCQLISfwxG3gFhdjloVFnI4FpGIfbFWsLLNR f+dyIQID2YxDXrZdWVjiBN3tZ0OksK4R+KrPU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer; b=ppLIpZKBQ/sbyT31yayq8ciD19GvlPX9LRteQOdCVJUjNYj0zyRAM6ZPDMAatn7fi+ vOXqX3yo8sJYGrBiwVLxzwrIKUTXM2YmxMZoHK/MYeKHbHRM/81x0QhqpybQvyDawerk U7hEbgn5fI5G8T3k/Spc/4ujMs0Pgb27SkejQ= Received: by 10.210.117.1 with SMTP id p1mr4964335ebc.84.1221744846674; Thu, 18 Sep 2008 06:34:06 -0700 (PDT) Received: from ?127.0.0.1? ( [217.206.187.80]) by mx.google.com with ESMTPS id g9sm7747394gvc.0.2008.09.18.06.34.04 (version=SSLv3 cipher=RC4-MD5); Thu, 18 Sep 2008 06:34:05 -0700 (PDT) From: Tom Evans To: David Naylor In-Reply-To: <200809180631.47071.naylor.b.david@gmail.com> References: <200809180631.47071.naylor.b.david@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-HzK5RTmMxvFERkURJjKR" Date: Thu, 18 Sep 2008 14:33:52 +0100 Message-Id: <1221744832.68732.4.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port Cc: freebsd-current@freebsd.org Subject: Re: FreeBSD deadlock (with fork?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 14:02:23 -0000 --=-HzK5RTmMxvFERkURJjKR Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2008-09-18 at 06:31 +0200, David Naylor wrote: > Hi, >=20 > I have a program that spawns a lot of subprocesses (with pipes open) from= =20 > multiple threads. The problem is the program often deadlocks, but not=20 > consistently. Sometimes the program can run over 5 times to competition=20 > without incidence and yet othertimes it locks within a few seconds. =20 >=20 Do you create threads, which then fork(), or do you fork() and then create = threads?=20 I think the former will not work.. Cheers Tom --=-HzK5RTmMxvFERkURJjKR Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkjSWLwACgkQlcRvFfyds/fmIgCfUQh21NO2FqkmGylH2syswyC5 IcgAn0ubHjnroSlQ9UEjGwt7OZydFys0 =7XeH -----END PGP SIGNATURE----- --=-HzK5RTmMxvFERkURJjKR--