Value will be same for all thread. There is no need to use lock with volatile field.
- Use a lock to protect all accesses (reads and writes) to the _loop field
- Mark the _loop field as volatile
I have created this blog to help those who are looking for a change in .Net. You can share your interview experience, problems and knowledge. Just mail your content at email@example.com. It will immediately published. Visit the blog for .Net FAQ,.Net interview questions,ASP .Net FAQ, C# .Net FAQ,ASP .Net interview questions, interview question on .Net, interview questions on C#.Before going to interview just go through the site.