English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] OC4MC : OCaml for Multicore architectures
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-09-24 (16:05)
From: Pascal Cuoq <Pascal.Cuoq@c...>
Subject: Re: [Caml-list] OC4MC : OCaml for Multicore architectures
On Sep 24, 2009, at 5:47 PM, Philippe Wang wrote:

>> Is the copy operation parallelized?
> Nope. When the world is stopped for the collection, everything is done
> sequentially until the world is resumed.
> I don't think it's relevant to parallelize the copy operation (hell to
> implement&debug, then I don't think that performance would be very
> interesting because we would probably need a write mutex on the
> destination heap)

Well, you could start copying to the bottom of the next heap with
one thread going up and to the top of it with another going down.
Assume optimistically that the two threads will not reach the same
cacheline at the end of the copies, and you don't need any
synchronisation at all between them, except joining at the end.

After checking, if they have reached the same cacheline,
you need to reallocate the destination heap anyway.

You still get a single unfragmented free block as a result.

Even better: stop the world just before there remains less that one
cacheline of free space and you don't need to check if the two threads  
met. You still need to reallocate the destination heap sometimes though.

Oh, and I meant to say, but everyone else was faster than me:
well done!