• Post Reply Bookmark Topic Watch Topic
  • New Topic

how will i improve performance when i use synchronization

 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
if synchronization keyword it will degrade the performace then
how will i improve performance when i use synchronization in methods
bye
chaitanya
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is moot. You use synchronization when you are forced too. Therefore there is no issue.
That is unless you are asking about techniques to avoid synchronization? Generally though synchronization is not bad. It can only make a slight difference when you put it in tight loops.
 
Azriel Abramovich
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMHO:
Try to synch small blocks and not whole methods. Use lock objects (. This will improve performance. Don't expect the moon and the sky, yet visible improvments.
I, personally, like this way more because it emphasizes the different locks in my code.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can. For some reason I have yet to find an opportunity to synchronize on something other than a complete method. I think because I make my methods do specific small tasks. Probably breaks down to the same thing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!