.net - Is it safe to use an Events with ThreadPool.RegisterWaitForSingleObject? -


Document

To use a mutation for waitObject, Exclusion does not provide callback because the built-in Win32 API uses the default WT_EXECUTEDEFAULT flag, so each callback is sent to a different thread pool thread. Instead of a muteuse, use a semaphore with the maximum number of 1.

and (in the document for WaitHandle logic) it says

use one

< / P>

It seems that it is safe to use an event - what is it?

Will there be any difference in using AutoResetEvent and a ManualResetEvent?

Events are okay I think I've used events with this method any time.

Auto vs manual reset events, only say that the end result of the waiting affects the object:

The function modifies the state of some type of synchronization object. Modification for objects or objects only occurs when the signal state returned the function.

Manual reset event never changes the state until you do it properly, okay, manually; I hope that an auto reset event is only for resetting myself, if it happens, due to which the wait is over, you will only notice that if you have two auto-reset event signals.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -