From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 22 14:57:17 2004 Return-Path: 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 561EF16A4CE; Tue, 22 Jun 2004 14:57:17 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 127FB43D54; Tue, 22 Jun 2004 14:57:17 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i5MEuXN6077186; Tue, 22 Jun 2004 09:56:33 -0500 (CDT) (envelope-from dan) Date: Tue, 22 Jun 2004 09:56:33 -0500 From: Dan Nelson To: Chris Stenton Message-ID: <20040622145632.GF86471@dan.emsphone.com> References: <011f01c4578b$923d7b70$4b7ba8c0@gnome.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <011f01c4578b$923d7b70$4b7ba8c0@gnome.co.uk> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: threads@freebsd.org cc: hackers@freebsd.org Subject: Re: pthread - fork - execv problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2004 14:57:17 -0000 In the last episode (Jun 21), Chris Stenton said: > I am trying to help port over an app thats posix threaded. One thread > uses fork, dup2 and execv to start a child programme in this case an > mp3 player. However, under FreeBSD-5.2.1, the execv causes all the > threads in the parent process to be blocked until the child process > returns. Is there a mechanism to get around this. Do you have a small testcase? I have not seen your problem in any other threaded programs on FreeBSD. It may be an application bug. After a fork both processes are independant. The child should not be able to affect the parent like this, unless the parent does something like holding a mutex used by all the threads and calling wait(). -- Dan Nelson dnelson@allantgroup.com