Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multithreading

Status
Not open for further replies.

luvcloud

Programmer
Apr 23, 2002
24
0
0
MY
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.

Hope it helped.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top