471,347 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,347 software developers and data experts.

Events(WaitHandle) and Monitor

Tim
Are AutoReset Event/ManualReset Event and Monitor.Pulse used for the same
purpose?

Can they be used interchangeably?
Jan 3 '06 #1
1 1557
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
Jan 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Waleed AlRashoud | last post: by
2 posts views Thread by MIke Brown | last post: by
15 posts views Thread by Bryce K. Nielsen | last post: by
1 post views Thread by rjha94 | last post: by
3 posts views Thread by =?Utf-8?B?VHJlY2l1cw==?= | last post: by
1 post views Thread by =?Utf-8?B?VHJlY2l1cw==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.