threading synchronization question

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
 
N

Natty Gur

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top