caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Benjamin Canou <benjamin.canou@gmail.com>
To: Caml List <caml-list@inria.fr>
Cc: Benjamin Canou <benjamin.canoou@gmail.com>,
	Emmanuel Chailloux <Emmanuel.Chailloux@lip6.fr>,
	Philippe Wang <philippe.wang@gmail.com>,
	adrien jonquet <adjonk@gmail.com>,
	Mathias Bourgoin <mathias.bourgoin@gmail.com>
Subject: Re: [Caml-list] OCaml Summer Project decisions are in
Date: Sat, 19 Apr 2008 16:21:48 +0200	[thread overview]
Message-ID: <1208614908.6790.53.camel@benjamin-laptop> (raw)
In-Reply-To: <b903a8570804190146g35312edbid0bb8e5e8e28dd01@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3930 bytes --]

  Hi,

I can understand why you are all excited about parallelism in OCaml, and
most of your questions/suggestions seem relevant.
However, for the technical questions about the choices of the
implementation, it is way too early for us to answer them.

About the bugs in library bindings, I'm afraid you are spotting a really
problematic problem. For example, if I remember well, gtk C functions
have to be called within the same thread in C (which is a smart way for
them to say that their code isn't reentrant), and this may raise a
problem if we add real parallelism to OCaml. But you understand that
rewriting lablgtk and/or programs using it is out of scope.

You also noticed that the task is not trivial, and are concerned about
the feasibility. In fact, we most probably won't have the time to find
the best solution.
So our proposal is to let this project be more "a first reusable step
toward parallelism in OCaml" than "a parallel OCaml".
More practically, we propose the following subtasks:
  1. To strip down the current run-time library, rewriting some parts
which are too much dependent on the current GC
  2. To clean the (small) parts of the compiler preventing us from
changing the allocator (for example, OCaml inlines some allocations by
directly emitting code which modifies the heap pointer).
  3. To define a clean and documented interface for adding new GCs,
ideally adding a run-time switch to choose the GC.
  4. To to reinject the current GC, or a simpler sequential GC we
already wrote for another work, using this interface to validate the
approach.
  5. To design a first parallel GC, simple enough for us to be able to
test and benchmark it before the end of the project and to implement it
within our interface.

With such an approach, we believe that the projet has a much greater
chance to survive and perhaps be in integrated upstream.
Also, with such a generic GC plugging interface, libraries will be able
to provide specific GCs. For example including some tricks to be able to
run gtk-like non reentrant C calls, or dedicated to tasks which are
currently problematic due to the current allocation mecanism, like
MLGMP.

We'll probably open a blog or wiki to inform you about the progression,
and collect suggestions and concerns.

Regards, and many thanks for your interest.
  Benjamin Canou.

Le samedi 19 avril 2008 à 10:46 +0200, Berke Durak a écrit :

> The concurrent GC is a great idea.  A few interrogations.
> 
> - How "stoppy" would a stop-the-world parallel GC be in practice?  The
> more parallelism
> you have, the more work is done, the higher the frequency of a major
> collection.
> 
> - Would major allocations be serialized?  What about other
> serialization points?
> 
> - I'm afraid true concurrency will introduce an awful lot of bugs in
> native bindings.  Thread-unsafe libraries will have to be replaced
> (Str, etc.)  Also what would be the CPU
> and memory costs?  Don't concurrent GCs require extra colors?
> 
> - In case of performance impacts, will the old single-threaded mode
> still be available?
> 
> The argument that "you'll get the same old perfomance if you run it in
> single-threaded mode"
> is not valid IMHO.  Many people will use a thread here or there and
> then you won't realistically be able to run in single-threaded mode.
> 
> But then we can't pretend multi-core doesn't exist.  A suggestion:
> making the parallel GC available only on 64-bit seems a reasonable
> restriction (if that's ever needed.)
> 
> Also Damien Doligez (in addition to Xavier Leroy) certainly have nice
> things to say about all this.
> -- 
> Berke Durak
> 
> 
> _______________________________________________
> 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

[-- Attachment #2: Type: text/html, Size: 5291 bytes --]

  reply	other threads:[~2008-04-19 14:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 14:51 Yaron Minsky
2008-04-18 15:46 ` [Caml-list] " Jon Harrop
2008-04-18 16:42 ` Dario Teixeira
2008-04-18 19:23   ` Yaron Minsky
2008-04-19  8:46     ` Berke Durak
2008-04-19 14:21       ` Benjamin Canou [this message]
2008-04-20 16:12         ` Xavier Leroy
2008-04-21  9:24           ` Berke Durak
2008-04-21 11:17             ` Jon Harrop
2008-04-19 11:29   ` Francois Pottier
2008-04-19 15:11     ` Dario Teixeira
2008-04-19 13:38 ` Sylvain Le Gall
2008-04-20 20:06 ` [Caml-list] " Florian Hars

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=1208614908.6790.53.camel@benjamin-laptop \
    --to=benjamin.canou@gmail.com \
    --cc=Emmanuel.Chailloux@lip6.fr \
    --cc=adjonk@gmail.com \
    --cc=benjamin.canoou@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=mathias.bourgoin@gmail.com \
    --cc=philippe.wang@gmail.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;
as well as URLs for NNTP newsgroup(s).