From: Brian Hurt <bhurt@spnz.org>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] We should all be forking
Date: Tue, 5 Jun 2007 19:58:31 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0706051951020.6016@localhost> (raw)
In-Reply-To: <200706051913.13481.jon@ffconsultancy.com>
On Tue, 5 Jun 2007, Jon Harrop wrote:
>
> Following on from our "why not fork" discussion, here is my most elegant
> concurrent ray tracer written in vanilla OCaml.
>
> This program simply runs four processes (forking off three) in parallel to
> improve performance when 2-4 CPUs are available (increase "d" if you have >4
> CPUs).
>
> This isn't as sophisticated as the JoCaml version but it does double
> performance (taking the time down from 4s to 2s) on my dual-core machine,
> making it faster than any language that uses a concurrent GC. I don't know
> about you guys, but this is a complete revelation for me!
This actually doesn't surprise me. Big linear algebra problems- like ray
tracing- are almost embarassingly parallel. This is why the supercomputer
market died a decade and a half ago- it was just too easy to take the
problems supercomputers were designed to handle and spread them out over
an cluster of workstations or pcs. What needs to be shared in the ray
tracing example? The model, obviously. And the results have to be
collected. And what subset of the problem (which collection of rays) need
to be worked on. I note that the big-iron database machine (aka
mainframe) market is alive and well. Some problems don't parallelize
quite so easily.
My point here is to caution against making too much soup from this lone
oyster. Simply because this program, and a large class of other programs
like it, parallelize easily, doesn't mean all will.
On the other hand, for programs that do parallelize this way, JoCaml looks
like a wonderful gift.
Brian
next prev parent reply other threads:[~2007-06-05 23:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-05 18:13 Jon Harrop
2007-06-05 18:25 ` [Caml-list] " Jonathan Bryant
2007-06-05 18:32 ` Joel Reymont
2007-06-05 18:46 ` Jon Harrop
2007-06-05 19:13 ` Chris King
2007-06-05 19:20 ` jocaml vs camlp3l Joel Reymont
2007-06-05 21:02 ` [Caml-list] " Erik de Castro Lopo
2007-06-05 23:58 ` Brian Hurt [this message]
2007-06-07 12:04 ` [Caml-list] We should all be forking Richard Jones
2007-06-14 10:09 ` Luc Maranget
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=Pine.LNX.4.64.0706051951020.6016@localhost \
--to=bhurt@spnz.org \
--cc=caml-list@inria.fr \
--cc=jon@ffconsultancy.com \
/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