Hi,
I am looking into using a producer\consumer threading pattern to run through a list of strings that i retrieve from a database and then am going to run powershell commands against. As the powershell commands can be quite intensive i only want to spawn 3 threads at a time and then wait for one thread to finish before doing anymore. I looked into the treadpool but it looks like it is used for more lightweight processing.
I am new to threading and have seen a few producer\consumer examples on the internet but am not sure how to handle the 3 thread loop situation using waithandles (if thats the way to do it). I think i have to use the waithandle.waitany to achieve the above but am not sure how to implement this. If someone could point me in the right direction i would be most appreciative
Thanks