Answers

Question and Answer:

  Home  C# (Sharp) Programming Language

⟩ How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#?

You want the lock statement, which is the same as Monitor Enter/Exit:

lock(obj) { // code }

translates to

try {

CriticalSection.Enter(obj);

// code

}

finally

{

CriticalSection.Exit(obj);

}

 125 views

More Questions for you: