There are two big things that can be done to improve how sections are currently implemented.
Move the dequeue logic out of DotMP.Parallel.Sections and into the DotMP.SectionsContainer class
Change the internal data structure from a Queue<T> to a ConcurrentBag<T>
The former will improve code organization, and the latter should remove an otherwise necessary lock. Additionally, a bag is a better data structure than a queue anyway.
There are two big things that can be done to improve how sections are currently implemented.
DotMP.Parallel.Sections
and into theDotMP.SectionsContainer
classQueue<T>
to aConcurrentBag<T>
The former will improve code organization, and the latter should remove an otherwise necessary lock. Additionally, a bag is a better data structure than a queue anyway.