In .NET 4 it is possible to enable concurrent GC.
Q1 How does it work with parallel computations: Parallel
, Task
, PLINQ etc?
Q2 As a software developer what shall I be aware of when working with concurrent GC?
- The Concurrent GC will work fine with parallel computations. It runs inside of its own dedicated thread - so it's already handling working in concert with other threads. The runtime itself handles any synchronization required for you.
- In general, you shouldn't have to worry about this at all. The beauty of the GC is that you rarely have to worry about its implementation details. The only time I would worry about this is more if you profile and discover that a large amount of your processing time is spent in GC. However, this is not really specific to one form of GC, but rather overall profiling and memory usage in general.
That being said, in .NET 4, the new "Background GC" was added. There is a detailed post describing this here as well as this Channel 9 video.