I have the following problem: I have large chunks of data and I want different threads to process a part of this data in parallel. First synchronization must take place here, such that all threads wait until the last thread has finished its process. Then, I want to trigger a writer-reader mechanism: Thread 0 makes a calculation using the data it has gathered from the data chunk and after it has done with the calculation, thread 1 starts to process its output. Thread 2 then uses thread 1's output and so on, in this particular order. After all threads finished this writer-reader sequence, they begin to work on the next data chunk.
I may implement this using fancy locking mechanisms but I am very positive that there should be special Task Parallel Library methods which I can use for a more easy and efficient solution. Are there any such methods in TPL that I can use for this kind of problem?