Threads pausing and resuming c#

前端 未结 5 1332
心在旅途
心在旅途 2021-01-13 19:39

I\'ve got several threads ,how can I pause/resume them?


From duplicate question:

How can i pause 5 threads, and to remember their status. Because one o

5条回答
  •  花落未央
    2021-01-13 20:08

    Have a look at Monitor.Wait and Monitor.Pulse in the first instance- Marc Gravell has a nice example used in a queue here.

    In it quite likely that you want to consider using a Producer/Consumer queue.

提交回复
热议问题