Is it possible to use events as a communication mechanism between threads?If by event you mean an event that can be raised from a class that can be
handled by another class that has added a handler for the event via a
delegate then the answer is no. An event of this type is executed in the
calling thread just like any method.
If by event you mean the kernel object called an event that is represented
by the Threading.ManualResetEvent and Threading.AutoResetEvent classes then
the answer is yes. These types of events are designed to be used to
synchronize multi-threaded behaviour or to signal some condition across
threads and so can be well suited to being part of an inter-thread
communication design.
"Ayende Rahien" <Ayende@.no.spam> wrote in message
news:Op$YJiFsDHA.2448@.TK2MSFTNGP12.phx.gbl...
> Is it possible to use events as a communication mechanism between threads?
Showing posts with label events. Show all posts
Showing posts with label events. Show all posts
Thursday, March 22, 2012
Subscribe to:
Posts (Atom)