Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Sep 1998 11:34:27 -0700
From:      Kurt Zeilenga <Kurt@Boolean.Net>
To:        HighWind Software Information <info@highwind.com>
Cc:        eischen@vigrid.com, freebsd-current@FreeBSD.ORG, tlambert@primenet.com, eischen@vigrid.com
Subject:   Re: Thread Problems
Message-ID:  <3.0.5.32.19980910113427.0099b940@localhost>
In-Reply-To: <199809101737.NAA17787@highwind.com>
References:  <35F80435.41C67EA6@vigrid.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.19980910113427.0099b940>