Browse thread
Fwd: [Caml-list] Faking concurrency using Unix forks and pipes
- Jonathan Bryant
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jonathan Bryant <jtbryant@v...> |
| Subject: | Fwd: [Caml-list] Faking concurrency using Unix forks and pipes |
Oops. Forgot to CC the list... Begin forwarded message: > From: Jonathan Bryant <jtbryant@valdosta.edu> > Date: May 30, 2007 3:43:50 PM EDT > To: Erik de Castro Lopo <mle+ocaml@mega-nerd.com> > Subject: Re: [Caml-list] Faking concurrency using Unix forks and pipes > > > On May 30, 2007, at 3:14 PM, Erik de Castro Lopo wrote: > >> >> To exploit multi-process message-passing style concurrency you >> need to >> fork early before much has been allocated. > > 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. 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). > > --Jonathan > >> >> Erik >> -- >> ----------------------------------------------------------------- >> Erik de Castro Lopo >> ----------------------------------------------------------------- >> "... a discussion of C++'s strengths and flaws always sounds >> like an argument about whether one should face north or east >> when one is sacrificing one's goat to the rain god." >> -- Thant Tessman >> >> _______________________________________________ >> Caml-list mailing list. Subscription management: >> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list >> Archives: http://caml.inria.fr >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >