aspose file tools*
The moose likes Performance and the fly likes Synchronized block Vs Concurrent Lock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Synchronized block Vs Concurrent Lock" Watch "Synchronized block Vs Concurrent Lock" New topic
Author

Synchronized block Vs Concurrent Lock

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1378
Which gives best performance Synchronized block / Concurrent Lock ?
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

kri shan wrote:Which gives best performance Synchronized block / Concurrent Lock ?

In theory, the latter is supposed to be more scalable, and does allow a bit more flexibility; but it comes at the expense of more code and thus more chances for "getting it wrong" and/or making things less readable.

Unless you're actually writing a critical multi-tasking system, I'd suggest you only use the latter if you can prove that it makes sense. And that means LOTS of testing of both forms.

Winston
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronized block Vs Concurrent Lock