caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Erik de Castro Lopo <mle+ocaml@mega-nerd.com>
To: caml-list@inria.fr
Subject: forking, threads and events
Date: Tue, 10 Oct 2006 22:16:07 +1000	[thread overview]
Message-ID: <20061010221607.7ecc5cba.mle+ocaml@mega-nerd.com> (raw)

Hi all,

I'm thinking about to start a new project which has some rather 
critical requirements. It will be compiled with the native compiler 
initially targeting Linux/Unix but eventually also windoze.

The app consists of a main engine which spawns many short lived 
child threads or processes. The children go away, do their work and 
then pass their results back to the main engine. Many of the children 
will spawn another process and read the child process output via a 
pipe and many of the children will block on I/O. A small portion of 
the children may be I/O bound, but there is not way of telling which 
beforehand.

Since I would like to maximize the throughput on multi-core and 
multi-processor machines I am thinking of using a mix of forking and 
threading. For communications, I was thinking of using the Event
module for communication between threads, but I don't think that
works for forked process (pipes maybe?).

Anybody have any advice for this project? Any war stories from similar
projects? Any readings they can recommend?

Thanks,
Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"Data is not information, Information is not knowledge, Knowledge is
not understanding, Understanding is not wisdom."
-- Clifford Stoll


             reply	other threads:[~2006-10-10 12:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 12:16 Erik de Castro Lopo [this message]
2006-10-10 12:38 ` [Caml-list] " Gerd Stolpmann
2006-10-11  0:23   ` Erik de Castro Lopo
     [not found] ` <1160490322.16459.110.camel@rosella.wigram>
2006-10-11  0:22   ` Erik de Castro Lopo

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=20061010221607.7ecc5cba.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;
as well as URLs for NNTP newsgroup(s).