DCSIMG
Blocking collection - Bnaya Eshet

Bnaya Eshet

Disclaimer

Browse by Tags

All Tags » Blocking collection (RSS)
Parallel.ForEach behavior
Parallel.ForEach behavior this post is a direct continuation for the previous post about " Real-life story: Blocking Collection ". (Real-life story: Blocking Collection).ContinueWith (t => this post); or await (Real-life story: Blocking Collection); this post; my colleague Bram Veldhoen has suggest to demonstrate the behavior of the Parallel.ForEach thread's hunger in more pure fashion which doesn't include BlockingCollection<T> or any other high level Enumerable. the following...
Real-life story: Blocking Collection
Real-life story: Blocking Collection this post will discuss a real-life story which uncover none trivial (yet logical) behavior which related to Parallel.ForEach and BlockingCollection<T> . I will explain why it happens and what how can we handle it right. it all start when Guy Eden from ITG has found that the following code seem to leak memory : Code Snippet private static void Main() { var bc = new BlockingCollection < int >(); Task .Factory.StartNew(() => Parallel .ForEach(bc.GetConsumingEnumerable...