caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Oliver Bandel <oliver@first.in-berlin.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: Threading and SharedMem (Re: [Caml-list] Re: Is OCaml fast?)
Date: Mon, 29 Nov 2010 17:24:40 +0100	[thread overview]
Message-ID: <1291047880.16005.533.camel@thinkpad> (raw)
In-Reply-To: <20101129171212.8439157ahjexnnq4@webmail.in-berlin.de>

Am Montag, den 29.11.2010, 17:12 +0100 schrieb Oliver Bandel:
> Zitat von "Gerd Stolpmann" <info@gerd-stolpmann.de>:
> 
> > Am Sonntag, den 28.11.2010, 19:14 +0100 schrieb
> > oliver@first.in-berlin.de:
> >> On Thu, Nov 25, 2010 at 11:50:58PM +0100, Fabrice Le Fessant wrote:
> >> [...]
> >> >  The main problem was that other languages have bigger standard
> >> > libraries, whereas OCaml has a very small one (just what is needed
> >> > to compile the compiler, actually). In many problems, you could
> >> > benefit from using a very simple shared-memory library (in
> >> > mandelbrot, the ocaml multicore solution has to copy the image in a
> >> > socket between processes, whereas it could just be in a shared
> >> > memory segment),
> >>
> >>
> >> ...so you work on a shared-mem module?!
> >
> > Don't know what Fabrice is referring to, but at least I work on a
> > multicore-enabling library:
> >
> > https://godirepo.camlcity.org/svn/lib-ocamlnet2/trunk/code/src/netmulticore/
> >
> > This is work in progress and highly experimental. What's currently
> > available:
> >
> > - managing processes and resources like files, shared memory objects
> >   etc.
> > - support for message passing via Netcamlbox (another library)
> > - low-level only so far: shared memory, including copying Ocaml values
> >   to and from shm
> [...]
> 
> You use shared mem(?), but you link only to *.ml files,
> and I see no *.c there.

cd ../netsys

it's part of a larger package

> 
> How can this be done?
> 
> At least not via the libs that are shipped with OCaml?!
> 
> I would have expected some *.c for the shared mem part and
> the creation of Caml-values....
> 
> 
> Ciao,
>     Oliver
> 
> P.S.: OCaml also provides a Thread-Lib, which seems to use pthread-lib.
>        Normally this should help in making things possible to run on multiple
>        cores. What are the restrictions  that this does not run that way?
>        Somehow... when all values are handled via one GC, then those threads
>        are somehow bound together, but on the other side, it works threaded,
>        and consumer-worker pipes and such stuff can be used.
>        So... somehow the GC seems to be the point, where the show will be
>        stopped? (Anyone who has looked inside OCaml here more detailed?)

Quite easy: there is a global lock, and when Ocaml code runs, this lock
must be acquired. So only one of the pthreads can have this lock, and so
only one pthread can run Ocaml code.

The reason is that memory management is not thread-safe.

Gerd

> 
> _______________________________________________
> 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
> 


-- 
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


  reply	other threads:[~2010-11-29 16:24 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 13:21 Is OCaml fast? Thanassis Tsiodras
2010-11-22 13:35 ` [Caml-list] " Gregory Bellier
2010-11-22 13:39   ` Lukasz Stafiniak
2010-11-22 13:42   ` Thomas Fischbacher
2010-11-22 13:43 ` Sylvain Le Gall
2010-11-22 13:55 ` [Caml-list] " Dario Teixeira
2010-11-23  2:11   ` Isaac Gouy
     [not found]   ` <999386690.746882.1290478813177.JavaMail.root@zmbs4.inria.fr>
2010-11-23  9:12     ` [Caml-list] " Fabrice Le Fessant
2010-11-23 17:56       ` Isaac Gouy
2010-11-23 19:54         ` [Caml-list] " Mark Diekhans
2010-11-23 20:04           ` Isaac Gouy
2010-11-23 22:56   ` [Caml-list] " oliver
2010-11-23 23:54     ` Jon Harrop
2010-11-24  1:24       ` Erik de Castro Lopo
2010-11-25 11:17         ` Jon Harrop
2010-11-22 14:04 ` Gerd Stolpmann
2010-11-22 14:22   ` [was: Re: Is OCaml fast?] OCaml Shootout task force Sylvain Le Gall
2010-11-22 14:36   ` [Caml-list] Is OCaml fast? bluestorm
2010-11-22 15:01     ` Török Edwin
2010-11-22 15:54       ` Goswin von Brederlow
2010-11-22 15:02     ` Gerd Stolpmann
     [not found]     ` <582306206.731582.1290438133628.JavaMail.root@zmbs4.inria.fr>
2010-11-22 16:46       ` Fabrice Le Fessant
2010-11-22 18:33         ` Török Edwin
2010-11-27 21:11           ` Pierre Etchemaïté
2010-11-28 13:26             ` OCaml GC [was Is OCaml fast?] Christophe Raffalli
2010-11-28 14:29               ` [Caml-list] " Benedikt Meurer
2010-11-28 18:57                 ` Eray Ozkural
2010-11-28 19:40                   ` Jon Harrop
2010-11-28 19:59                     ` Benedikt Meurer
2010-11-28 23:34                       ` Jon Harrop
2010-11-29 12:11                         ` Benedikt Meurer
2010-11-29 22:27                 ` Török Edwin
     [not found]                 ` <916556265.243293.1291069665032.JavaMail.root@zmbs1.inria.fr>
2010-12-02 12:57                   ` Damien Doligez
2010-12-02 15:07                     ` Török Edwin
2010-12-03 21:42                       ` [Caml-list] optimizing caml_modify [was OCaml GC [was Is OCaml fast?]] ygrek
2010-11-23  2:03     ` Is OCaml fast? Isaac Gouy
2010-11-23 10:37       ` [Caml-list] " Christophe TROESTLER
2010-11-23 15:50         ` Jon Harrop
2010-11-23 18:06           ` Isaac Gouy
2010-11-23 21:34             ` [Caml-list] " Jon Harrop
2010-11-23 16:08         ` Jon Harrop
2010-11-23 18:03           ` Isaac Gouy
2010-11-23 19:14             ` [Caml-list] " Török Edwin
2010-11-23 20:17               ` Isaac Gouy
2010-11-23 21:14             ` [Caml-list] " Christophe TROESTLER
2010-11-23 21:55               ` Isaac Gouy
2010-11-23 22:25             ` [Caml-list] " Richard Jones
2010-11-24  0:11               ` Isaac Gouy
2010-11-23 17:53         ` Isaac Gouy
2010-11-23 19:24           ` [Caml-list] " Gerd Stolpmann
2010-11-23 20:28             ` Isaac Gouy
2010-11-23 20:55               ` [Caml-list] " Gerd Stolpmann
2010-11-23 21:32                 ` Isaac Gouy
2010-11-24 22:28             ` [Caml-list] " Goswin von Brederlow
2010-11-23 23:21           ` evil sloot
2010-11-24  6:54             ` [Caml-list] " David Rajchenbach-Teller
2010-11-22 17:02   ` [Caml-list] " Oliver Bandel
2010-11-22 17:08     ` David Rajchenbach-Teller
2010-11-22 17:23       ` Oliver Bandel
2010-11-22 17:54         ` David Rajchenbach-Teller
2010-11-22 23:55         ` Jeff Schultz
2010-11-22 23:28       ` Eray Ozkural
2010-11-23  2:01       ` Isaac Gouy
2010-11-23 23:27         ` [Caml-list] " oliver
2010-11-24  0:23           ` Isaac Gouy
2010-11-24  1:36             ` [Caml-list] " Eray Ozkural
2010-11-24  2:13               ` Isaac Gouy
2010-11-24  4:39                 ` [Caml-list] " Jeff Meister
2010-11-24  6:22                   ` Andrew
2010-11-24  7:16                     ` Isaac Gouy
2010-11-24  6:50                   ` Isaac Gouy
2010-11-24 10:24                     ` [Caml-list] " Christophe Troestler
2010-11-24 11:33                       ` Eray Ozkural
2010-11-24 17:32                       ` Isaac Gouy
2010-11-24 17:57                         ` [Caml-list] " Christophe Raffalli
2010-11-24 19:07                         ` Ed Keith
2010-11-24 19:13                           ` Isaac Gouy
2010-11-24 19:17                             ` [Caml-list] " David Rajchenbach-Teller
2010-11-24 22:25                               ` Oliver Bandel
2010-11-25 16:59                   ` Stefan Monnier
2010-11-25 18:21                     ` Isaac Gouy
2010-11-25 22:11                     ` [Caml-list] " Jon Harrop
     [not found]                     ` <1534555381.33107.1290723160355.JavaMail.root@zmbs4.inria.fr>
2010-11-25 22:50                       ` Fabrice Le Fessant
2010-11-26 20:25                         ` Isaac Gouy
2010-11-27 18:55                         ` Stefan Monnier
2010-11-28 18:14                         ` [Caml-list] " oliver
2010-11-29 14:19                           ` Gerd Stolpmann
2010-11-29 16:12                             ` Threading and SharedMem (Re: [Caml-list] Re: Is OCaml fast?) Oliver Bandel
2010-11-29 16:24                               ` Gerd Stolpmann [this message]
2010-11-29 16:33                                 ` Oliver Bandel
2010-11-27 15:58                     ` [Caml-list] Re: Is OCaml fast? Christophe Raffalli
2010-11-28 18:17                       ` oliver
2010-11-29  7:33                         ` Christophe Raffalli
2010-11-29 11:25                           ` Jon Harrop
2010-11-29 11:44                             ` oliver
2010-11-29 17:29                               ` Christophe Raffalli
2010-11-24  6:55               ` David Rajchenbach-Teller
2010-11-24  7:23                 ` Isaac Gouy
2010-11-23  2:06   ` Isaac Gouy
     [not found] ` <1110536178.728445.1290434684177.JavaMail.root@zmbs4.inria.fr>
2010-11-22 16:39   ` [Caml-list] " Fabrice Le Fessant
2010-11-22 17:21     ` Philippe Strauss
2010-11-22 18:33 ` Oliver Bandel
2010-11-23  1:58 ` Isaac Gouy
2010-11-24 10:29 ` [Caml-list] " David Allsopp
2010-11-24 18:39   ` Isaac Gouy
2010-11-24 20:59     ` [Caml-list] " David Allsopp
2010-11-25  0:16       ` Isaac Gouy
2010-11-24 14:07 ` [Caml-list] " Cedric Cellier
2010-11-24 14:34 ` Vincent Aravantinos
2010-11-24 15:30   ` Thanassis Tsiodras
2010-11-24 16:26     ` Oliver Bandel
2010-11-24 16:27     ` Vincent Aravantinos
2010-11-24 18:16 ` Isaac Gouy
     [not found] <fa.sn187DUeFX1sJ62LL4s6SatUR/c@ifi.uio.no>
     [not found] ` <fa.PTndTGw0Otg08P5/YMoxmRptrPs@ifi.uio.no>
     [not found]   ` <fa.0ulojaV8bXHHiRN+1r6S98RGEsw@ifi.uio.no>
     [not found]     ` <fa.gQ7B1GYcdbBVupZowIyW2+1E/b4@ifi.uio.no>
     [not found]       ` <fa.ludbTMBmN7YGqnEwsRPwOGCpjrA@ifi.uio.no>
     [not found]         ` <fa.srfZThtnO8lApSpMeW3POD462Xg@ifi.uio.no>
2010-11-30  8:10           ` Threading and SharedMem (Re: [Caml-list] Re: Is OCaml fast?) Stephan Houben
2010-11-30 12:55             ` oliver
2010-11-30 13:06               ` Eray Ozkural
2010-11-30 21:13                 ` Jon Harrop
2010-11-30 21:28                   ` Christophe Raffalli
2010-11-30 14:09               ` Gerd Stolpmann
     [not found] <fa.B9mcuN46iEGhXlge41VUCLz69+Y@ifi.uio.no>
     [not found] ` <fa.D3cDWzaD9Uu03+KvekpwpBGCx7o@ifi.uio.no>
     [not found]   ` <fa.xsCCCeDYPj8J16i9UrdqxoOIQ0Y@ifi.uio.no>
     [not found]     ` <fa.SW2Swldk88Bs5ujaNHT8Yh4bXkg@ifi.uio.no>
     [not found]       ` <fa.V+M6RbukE/w/Aftpwxkx2MvkxlU@ifi.uio.no>
     [not found]         ` <fa.+OkqNL3AB4+5LA8wOnQD9WS59QQ@ifi.uio.no>
2010-11-30 14:04           ` Stephan Houben
2010-11-30 14:22             ` Gerd Stolpmann
2010-11-30 14:29             ` oliver
2010-11-30 15:17               ` Eray Ozkural
     [not found] <fa.eehhGhbses+7RvDlflKpXQ8Uu34@ifi.uio.no>
     [not found] ` <fa.UVXWB7NnPNJbhh0Cf2OLmzYx/bQ@ifi.uio.no>
     [not found]   ` <fa.uksiRZ6fYFia4X1fXQaWa8z4Kio@ifi.uio.no>
     [not found]     ` <fa.Zv2Wkh0+DJAuXcOzq+qABiYFTP4@ifi.uio.no>
     [not found]       ` <fa.W5DnVSXs073N1X2rbtpyh7iGAcc@ifi.uio.no>
     [not found]         ` <fa.LGfjfIGKcYLW6PBxy7aMsEnvy/w@ifi.uio.no>
2010-11-30 15:30           ` Stephan Houben
2010-11-30 16:07             ` Gerd Stolpmann
2010-11-30 17:40               ` oliver

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=1291047880.16005.533.camel@thinkpad \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=oliver@first.in-berlin.de \
    /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).