caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jonathan_T_Bryant <jtbryant@valdosta.edu>
To: David.Teller@ens-lyon.org, caml-list@inria.fr
Subject: Re: [Caml-list] How INRIA people envision OCaml's parallel future?
Date: Fri, 24 Jun 2005 13:02:55 -0400	[thread overview]
Message-ID: <1119632575.16349.23.camel@starlight.valdosta.edu> (raw)
In-Reply-To: <1119630886.18424.1.camel@calaf.rn.informatics.scitech.susx.ac.uk>

A shared memory segment is just a void pointer (in C), but the problem
is that the static typing in OCaml does not allow that kind of lunacy,
thank God.  I guess that internally OCaml could see it as an array of
some type and do some basic memory management on its own.  Or, while
slightly more sophisticated and complicated, maybe it could serve as a
non-garbage collected static sized heap (OCaml would have to do some
memory management, though).  For example:

Shm.get *some params* : Get a segment
Shm.attatch *param*   : Attatch
Shm.detatch *params*  : Detatch
Shm.control *params*  : Control the segment
Shm.to_shared_heap *param* : Move something on the main heap to this
heap
Shm.to_gc_heap *param* : Move something from this heap to the main GC-ed
heap

Like all of my comments on this subject, I'd like to remind everyone
that I'm not a GC expert or a language expert, but a code jockey.  I
just know what would make my life easier.

On Fri, 2005-06-24 at 17:34 +0100, David Teller wrote:
> How would you handle the shared memory ?
> 
> I'm all for typed channels between processes, though. Although I don't
> know how you could typecheck this, except perhaps by doing it the Acute
> way (i.e. new names, which can be distributed).
> 
> Cheers,
>  David
> 
> On Fri, 2005-06-24 at 12:14 -0400, Jonathan_T_Bryant wrote:
> > Well, one of the easiest ways is to extend the Unix library to be able
> > to include the shared memory and semaphores system calls (shmget, shmat,
> > shmctl, shmdt, semget, semctl, and a couple of others, too).  That way
> > heavyweight processes could simulate threads (they CAN take advantage of
> > multiple processors but can also share data.  That would be the easiest
> > way to "solve" (if only partially) the problem.
> > 
> > --Jonathan
> 
> 


  parent reply	other threads:[~2005-06-24 17:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-23  7:21 David MENTRE
2005-06-23  8:33 ` [Caml-list] " Frédéric Gava
2005-06-23  9:28   ` David MENTRE
2005-06-23 17:20 ` Jonathan_T_Bryant
2005-06-24  8:52   ` Jean-Marie Gaillourdet
2005-06-24  9:36     ` David MENTRE
2005-06-24 12:50       ` David MENTRE
2005-06-24 16:14         ` Jonathan_T_Bryant
     [not found]           ` <1119630886.18424.1.camel@calaf.rn.informatics.scitech.susx.ac.uk>
2005-06-24 17:02             ` Jonathan_T_Bryant [this message]
2005-06-24 16:59         ` Eric Stokes
2005-06-24 18:25           ` XDR and ASN.1 (was: Re: [Caml-list] How INRIA people envision OCaml's parallel future?) David MENTRE
2005-06-24 22:46           ` [Caml-list] How INRIA people envision OCaml's parallel future? Erik de Castro Lopo

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=1119632575.16349.23.camel@starlight.valdosta.edu \
    --to=jtbryant@valdosta.edu \
    --cc=David.Teller@ens-lyon.org \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).