caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Shawn W." <shawnw@speakeasy.org>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] re: We should all be forking
Date: Wed, 6 Jun 2007 10:51:44 -0700	[thread overview]
Message-ID: <87557961-A7FE-4FC7-B42A-A1BDF8992712@speakeasy.org> (raw)
In-Reply-To: <20070606092840.GH348@first.in-berlin.de>


On Jun 6, 2007, at 2:28 AM, Oliver Bandel wrote:
>
> vfork is only (!!!) for a fork-exec combination.
>
> So, be aware: do not use vfork, if you don't exec right after it!
>

Don't use it even then! The only functions a vfork()ed child process  
can call are an exec*() one or _exit() (And then I think only execv()  
and execve() are safe). It can't return from the function vfork() was  
called in. It can't safely modify variables.

In other words, it can't do any error handling to speak of if the  
exec fails. Sure, it's faster than a fork() (Even on a OS that does  
copy-on-right memory pages -- which most modern ones do) because you  
don't copy process table structures.... but it's way too fragile when  
something goes wrong. Which will happen, sooner or later.

-- 
Shawn W.
shawnw@speakeasy.org




      reply	other threads:[~2007-06-06 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 22:30 Christopher Cramer
2007-06-05 22:53 ` [Caml-list] " Eric Cooper
2007-06-06  9:28 ` Oliver Bandel
2007-06-06 17:51   ` Shawn W. [this message]

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=87557961-A7FE-4FC7-B42A-A1BDF8992712@speakeasy.org \
    --to=shawnw@speakeasy.org \
    --cc=caml-list@yquem.inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).