What is the basic concept behind WaitHandle?

前端 未结 5 1859
清歌不尽
清歌不尽 2020-12-04 14:04

What is the basic concept behind WaitHandle in C# .net threading? Whats is its use? When to use it? What is the use of WaitAll and Wait

5条回答
  •  不知归路
    2020-12-04 14:31

    There are some very long answers here. For anyone looking for the short answer:

    Wait handle are a mechanism for making one thread wait until another thread reaches a certain point.

    You can also have several threads waiting and/or several threads that are being waited for, hence the WaitOne, WaitAll and WaitAny methods. There are also several options for semantics available by choosing one of these classes: Mutex, Semaphore, ManualResetEvent, AutoResetEvent which are well documented.

提交回复
热议问题