Tim <Ti*@discussions.microsoft.com> wrote:
Are AutoReset Event/ManualReset Event and Monitor.Pulse used for the same
purpose?
Can they be used interchangeably?
There are various situations where they can be used for the same
purposes, but there are situations where you *have* to use WaitHandles
(waiting on multiple atomically etc) and many situations where it's
preferable to use Monitors (easier to lock with language support etc).
See
http://www.pobox.com/~skeet/csharp/t...thandles.shtml for a
general description.
Usually, I'd prefer to use Monitors, but others prefer WaitHandles. I
suspect it depends on your background - I have a Java background, which
uses monitors.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too