I have typical producer-consumer application. I have BlockingCollection to provide producing-consuming mechanism. What I need is to add ability to pause consumer thread execution fr开发者_如何学JAVAom another thread. I've read about different .net synchronization primitives but I can't decide how to implement it in the easiest way.
P.S.: I use .net 4.0.
Use an AutoResetEvent and wait on it in the Consumer until the other thread wakes it up again, by setting it to signaled.
精彩评论