Interviewer And Interviewee Guide

C# (Sharp) Programming Language Interview Question:

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

Submitted by: Administrator
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);
}

Submitted by: Administrator

Read Online C# (Sharp) Programming Language Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.