|
![](/i/fill.gif) |
On 15/03/2012 02:42 PM, Warp wrote:
> A concurrent compacting GC sounds to me like a very hard problem.
Everybody seems to think they know how it could be done... and yet,
nobody has written the code that does it.
> If the GC moves objects around in RAM, it has to make sure that no code
> is modifying the object while the GC is moving it. How does it achieve
> that efficiently, I have no idea.
Well, Haskell currently does thinks like have a separate heap for each
processor core. But that doesn't guarantee there are no pointers from
one heap to another, so you still gotta be careful. What you would
probably do is "mark" each object somehow, before you go about moving
it. Trouble is, that adds the overhead of testing whether each object is
marked every single time you want to access any object...
I'm sure it can be implemented somehow. The question is how complicated
it would be, and how much overhead it would add.
Post a reply to this message
|
![](/i/fill.gif) |