Spawning worker threads
Posted
by LB
on Stack Overflow
See other posts from Stack Overflow
or by LB
Published on 2010-04-22T17:53:10Z
Indexed on
2010/04/22
18:03 UTC
Read the original article
Hit count: 331
multithreading
|c#
In C#,
How would one go about spawning multiple threads and then sequentially adding results to a list before returning the entire result set?
What are some best practices?
I'm so far using an ManualResetEvent to signal when the last element has been processed by a thread.
But when it returns, I need to have them consolidate the result sets in sequential order so that we don't get into contention issues with the return value list (total results).
© Stack Overflow or respective owner