From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Efficient parallel programming without a concurrent GC
Date: Thu, 2 Apr 2009 08:16:21 +0100 [thread overview]
Message-ID: <200904020816.21471.jon@ffconsultancy.com> (raw)
I believe I have envisaged a useful and feasible way to combine the benefits
of OCaml's GC with efficient parallel programming without requiring a
concurrent GC.
I have been considering the ramifications of being able to quote HLVM code in
camlp4 macros as a DSL from within OCaml programs. That would combine OCaml's
better toolchain with HLVM's better numerical performance and (in the future)
efficient parallelism.
For example, a program might initialize an OCaml bigarray representing the
physical state of a simulation or computer game environment and call into
HLVM to have the state updated in-place using efficient parallel algorithms
implemented as multithreaded code. The result could even be passed directly
to OpenGL for visualization. In particular, the OCaml code responsible for
the UI would benefit from short pause times whereas the HLVM code responsible
for number crunching would benefit from high throughput.
This approach appears to solve almost all of the outstanding problems because
the programmer can choose between two different ways to execute code that
have different characteristics and the two modes of evaluation can run
concurrently using shared state for O(1) communication. Moreover, neither
side is burdened with the inefficiencies of a concurrent GC.
The disadvantage is that the two GCs must remain oblivious to each other so
data passed between them must be managed manually. However, that seems like a
small price to pay because the data will inevitably be arrays of value types
that are easily managed.
Does that sound valuable?
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
reply other threads:[~2009-04-02 7:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200904020816.21471.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--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