Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Erik de Castro Lopo <mle+ocaml@mega-nerd.com>
To: caml-list@inria.fr
Subject: Re: Fwd: [Caml-list] Faking concurrency using Unix forks and pipes
Date: Thu, 31 May 2007 05:57:56 +1000	[thread overview]
Message-ID: <20070531055756.2e328baa.mle+ocaml@mega-nerd.com> (raw)
In-Reply-To: <4C7DF773-3B6F-464F-8D90-CE240B91AEE5@valdosta.edu>

Jonathan Bryant wrote:

> What I've always done to get around this is fork a process at the  
> very beginning of the code, and whenever I need to fork a process  
> later, I fork one from that process.  That way almost nothing is in  
> the heap.

Yep, that works. Its also probably something that could be built 
into the JoCaml extension.

>  I do have worries about the efficiency of this though:  
> when marshaling a closure across a socket to another process, it  
> must marshal all the necessary state as well.  I would imagine this  
> has the potential to get slow if there was much state to marshal  
> (i.e., a closure marshaled referencing a large data structure).

This is a potential problem. This is like so many language features
that if misused, can lead to huge performance degradations. Knowing
about the problem beforehand allows programmers to avoid it.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"If you have an apple and I have  an apple and we  exchange apples then
you and I will still each have  one apple. But  if you have an idea and I
have an idea and we exchange these ideas, then each of us will have two
ideas." -- George Bernard Shaw


  reply	other threads:[~2007-05-30 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5F7D2956-2B0A-465A-8AC2-06D7EDC457F9@valdosta.edu>
2007-05-30 19:44 ` Jonathan Bryant
2007-05-30 19:57   ` Erik de Castro Lopo [this message]
2007-05-30 20:05     ` Jonathan Bryant
2007-05-30 22:08       ` Jon Harrop

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=20070531055756.2e328baa.mle+ocaml@mega-nerd.com \
    --to=mle+ocaml@mega-nerd.com \
    --cc=caml-list@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