Threading and the Garbage handler mess.

Sergey Gromov snake.scaly at gmail.com
Mon Sep 8 08:59:02 PDT 2008


Craig Black <cblack at ara.com> wrote:
> 
> > There *should* be a
> > benefit from collecting garbage in parallel, especially after number of
> > cores raises to dozens.
> 
> Do you know something I don't?  According to my research, a separate thread 
> touching everyone else's memory causes huge amounts of cache misses and page 
> faults.  These far outweigh any benefit gleaned from running the GC in 
> parallel.

A 'separate thread touching everyone else's memory' would inevitably 
require to pause 'everyone' so that wasn't what I was talking about.  I 
was talking about a hypothetical situation when every thread were 
collecting its own garbage leaving other threads' garbage alone.  This 
approach, assuming large amounts of thread-local garbage, would 
definitely benefit from parallelization.  But, even being hypothetical, 
it couldn't be free, and inevitable overhead may outweight benefits if 
number of parallel units is small.



More information about the Digitalmars-d mailing list