The standard implementation of many loose constructions, such as a parallel hash table, is often nearly impossible to write without a garbage collector. These structures work by storing long linked lists of items and then changing the heads of the lists whenever a new value is added or removed. Thus, one thread can make changes to the structure so that new threads consider the change (they cross the new linked list), while old threads continue reading the old linked lists. It is imperative that the memory be corrected by the garbage collector, because otherwise the thread that changed the linked list must somehow clear the list that it just replaced, but this list is used by other threads, it either leads to data races , or requires the use of locks,both of which are bad.
, .