From owner-freebsd-current Thu Sep 10 11:34:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA25854 for freebsd-current-outgoing; Thu, 10 Sep 1998 11:34:29 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from galois.boolean.net (galois.boolean.net [209.133.111.74]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA25839 for ; Thu, 10 Sep 1998 11:34:27 -0700 (PDT) (envelope-from Kurt@Boolean.Net) Received: from gypsy (galois.boolean.net [209.133.111.74]) by galois.boolean.net (8.8.8/8.8.8) with SMTP id SAA10516; Thu, 10 Sep 1998 18:35:09 GMT (envelope-from Kurt@Boolean.Net) Message-Id: <3.0.5.32.19980910113427.0099b940@localhost> X-Sender: kurt@localhost (Unverified) X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Thu, 10 Sep 1998 11:34:27 -0700 To: HighWind Software Information From: Kurt Zeilenga Subject: Re: Thread Problems Cc: eischen@vigrid.com, freebsd-current@FreeBSD.ORG, tlambert@primenet.com, eischen@vigrid.com In-Reply-To: <199809101737.NAA17787@highwind.com> References: <35F80435.41C67EA6@vigrid.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 01:37 PM 9/10/98 -0400, HighWind Software Information wrote: >> A simple solution that you can make in your application, is to close >> all relevent sockets after the fork and before the execl. > >Seems to me that this is the only really workable solution. I would suggest forking and exec'ing before creating any threads. If that is not possible, you should consider using a surrogate parent model. Basically, fork a single-threaded process before creating any threads to act as a surrogate parent. When the original, now threaded, program needs to fork a child, have the surrogate perform the fork() and exec(). Nichols, et. al., "Pthreads Programming" (O'Reilly) has a great discussion about using fork() and exec() with threads. Kurt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message