DConf 2013 Day 1 Talk 6: Concurrent Garbage Collection for D by Leandro Lucarella

Leandro Lucarella luca at llucax.com.ar
Mon May 27 09:42:40 PDT 2013


Vladimir Panteleev, el 24 de May a las 09:55 me escribiste:
> >When the GC is run:
> >- Use VirtualProtect to mark all mutable memory pages as read-only
> >- Add a vectored exception handler to handle the access violation
> >exception
> >- Resume the GC thread
> 
> I've tried writing a generational GC for D that used page protection
> for write barriers a while ago. IIRC, I ran into performance issues
> (the page faults were rather expensive).

Yeah, using memory protection to do what fork does manually is a known
approach, discussed even in the "Garbage Collection" book[1].

The good thing about fork is it's sooooo much easier to implement, and
the OS is already highly tuned to do this for you. That's why, even when
it might be good to explore, is not a very tempting approach for me (but
I have it in mind as an alternative way to "fix" the potential deadlock
caused by glibc internal mutex).

> This approach does have the benefit that it will not cause pages
> that have been moved to swap to be pulled out in order to be scanned
> every time, though.

[1] http://books.google.de/books/about/Garbage_Collection.html?id=UdtQAAAAMAAJ&redir_esc=y

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Se ha dicho tanto que las apariencias engañan
Por supuesto que engañarán a quien sea tan vulgar como para creerlo


More information about the Digitalmars-d-announce mailing list