delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/18/20:48:00

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B562E64.9DA372C3@nc.rr.com>
Date: Wed, 18 Jul 2001 20:48:36 -0400
From: Greg Smith <gsmith AT nc DOT rr DOT com>
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Threaded Cygwin Python Import Problem
References: <3B56201A DOT 8137A41E AT nc DOT rr DOT com> <20010718200853 DOT A5083 AT redhat DOT com>

I quite agree.  I suppose this will require a linked structure
pointing to locks/conditions that need to be re-initialized
(attributes, threads/lock/condition/whatever, are probably ok?).

But thinking of forking a threaded process makes my head hurt ;-)
So, can I be so bold as to ask a few questions ?? I know I can
discern the answers by RTFS, but it would help to hear the answer
from an authoritative source, and maybe save a little research
along the way...

In a threaded process, when fork() is issued, are all the threads
created in the new process, or just the thread that did the fork ?
I'd guess the latter; what if a separate thread owned a lock and
was doing it's thing ? then you wouldn't want the new process to
do the same thing thinking it owned the lock too ?  In our application,
that we discussed the other day, we had a problem in 98/me where
fork failed issued by a non-main thread, but all it wanted to do
was asynchrously issue a shell command; it might be catastrophic if
the threaded environment was replicated...

Anyway, I'll start reading the source.

Thanks,

Greg

Christopher Faylor wrote:
> >But, it looks like fork_copy() blindly copies everything from the
> >original process address space to the new address space, including
> >any pthread_mutex_t structures.
> If that is the case then a "fixup_after_fork" routine is probably
> required.  You can see several of those in fork.cc.
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019