When working with multi threaded applications, we tend to spawn worker threads which can lead to ineffective code when not done correctly, for example threads will not get reused and will be recreated for each work items. The solution to all those problems is a ThreadPool which reuses threads and queues work items that are consumed by those threads. This sort of implementation while simple can have side effects as unless the pool Queue is immutable it will have to be locked each time an item Enqueued and...

Dziel się z innymi:
Work Stealing | Passion of Programming in .NET

Inne 4569 dni, 11 godzin, 52 minuty temu http://badamczewski.blogspo... 213 pokaż kod licznika zwiń