Version française
Home     About     Download     Resources     Contact us    
Browse thread
Fwd: [Caml-list] Faking concurrency using Unix forks and pipes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Faking concurrency using Unix forks and pipes
On Wednesday 30 May 2007 21:05:11 Jonathan Bryant wrote:
> Just throwing out an idea, so someone who is more familiar with the
> GC/runtime correct me if this can't be done, but what about a smaller
> separate heap in shared memory that is reserved for concurrent data?
> Maybe you could declare a type
>
> stype 'a tree =
>
> | Node of 'a * 'a tree * 'a tree
> | Leaf of 'a
>
> that is always allocated in the shared heap, and have a separate GC
> thread that manages that heap.  Could that GC be concurrent without
> affecting the performance of non-concurrent data?

The programmer would need to explicitly move data from one heap to another, 
which undermines the high-level nature of a functional programming language. 
You'd be back to C-style memory allocation.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?e