From: Matthew Hannigan <mlh@zip.com.au>
To: Oliver Bandel <oliver@first.in-berlin.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Threads & Fork
Date: Wed, 23 Nov 2005 14:34:53 +1100 [thread overview]
Message-ID: <20051123033453.GB11205@zipworld.com.au> (raw)
In-Reply-To: <20051122155002.GB16451@first.in-berlin.de>
On Tue, Nov 22, 2005 at 04:50:02PM +0100, Oliver Bandel wrote:
> On Tue, Nov 22, 2005 at 04:39:07PM +0100, Florian Weimer wrote:
> > * Jonathan Bryant:
> >
> > > I'm confused as to why the attached code hangs. My understanding of
> > > Unix.fork () is that it completely clones the current process, which in
> > > my understanding, clones the processes's threads as well. Apparently,
> > > though, that is not the case, because I can't join the thread in both
> > > the parent and the child.
> >
> > I can't speak for the OCaml run-time, but POSIX fork only duplicates
> > the current thread, so the new process is essentially single-threaded.
>
> I doubt that this is true.
> Unix-fork() copies a complete process.
> If the original has threads, the copy also have.
> I don't think that POSIX handles this different to old Unix API.
from the solaris10 man page for fork; note the last sentence.
A call to fork1() replicates only the
calling thread in the child process.
In Solaris 10, a call to fork() is identical to a call to
fork1(); only the calling thread is replicated in the child
process. This is the POSIX-specified behavior for fork().
--
Matt
next prev parent reply other threads:[~2005-11-23 3:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-22 15:39 Jonathan Bryant
2005-11-22 15:03 ` [Caml-list] " Oliver Bandel
2005-11-22 15:39 ` Florian Weimer
2005-11-22 15:50 ` Oliver Bandel
2005-11-22 16:01 ` David Teller
2005-11-22 17:32 ` Alexander S. Usov
2005-11-22 20:56 ` Oliver Bandel
2005-11-23 3:34 ` Matthew Hannigan [this message]
2005-11-22 16:01 ` Christophe Raffalli
2005-11-22 20:46 ` Oliver Bandel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051123033453.GB11205@zipworld.com.au \
--to=mlh@zip.com.au \
--cc=caml-list@inria.fr \
--cc=oliver@first.in-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox