They both seem to fulfill the same purpose. When would I chose one over the other?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the events when you’ve got a thread that is waiting on one of or all of a number of events to do something.
Use the monitor if you want to restrict access to a data structure by limiting how many threads can access it.
Monitors usually protect a resource, whereas events tell you something’s happening, like the application shutting down.
Also, events can be named (see the OpenExisting method), this allows them to be used for synchronization across different processes.