i read that the synchronization in Java utilizes a 'lock'..this is similar to the use of 'lock' keyword and also the monitor class in C# rite? anyone can explain this more in detail, like whether there is a difference?
Hi, I just know tyhat in java one uses the synchronized keyword, which garantees that the "synchronized" part (usually a method) is accessed by only one thread at a time.
I suppose that "synchronized" in c# might be "lock" or whatever they copied.
Java implicitly uses Monitors (read up on Hoare monitors) and demarks the critical sections of code (i.e. for which the monitor lock is required) with the synchronized keyword.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.