threading synchronization question

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hi,

I have a question regarding the Event classes. The ManualResetEvent class
exposes the WaitOne(int,bool) method.
Now I am familiar with threading, events, mutexes, synchronization issues,
etc, but I am still baffled by the second parameter to this method. This is
what the MSDN documentation says about the bool parameter to WaitOne:

"exitContext: true to exit the synchronization domain for the context before
the wait (if in a synchronized context), and reacquire it; otherwise, false"

Can anyone explain in english what this means? Perhaps with an example?

Thanks!

-Jim
 
Hi,
if you aplay synchronization to class only one thread can be executing
in all contexts that share an instance of this property. if you are
using WaitOne your thread will be blocked. in that case you might want
to exit the synchronization domain and let other threads using that
class.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
tml/frlrfsystemruntimeremotingcontextssynchronizationattributeclasstopic
.asp

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top