Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Concurrency - Any Advantages  RSS feed

 
Thomas Hauck
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question:
Do synchronized collections provide higher performance than when working with two threads (without using java.util.concurrent)?

Is there an advantage of using the Concurrent Collections as opposed to using threads ?
 
Paul Clapham
Sheriff
Posts: 22531
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main advantage, in my opinion, is that you can use the concurrent collections right away, instead of having to write -- and test and debug -- your own low-level synchronization code. And yes, they most likely provide better performance than the code that you (or I) would have written because they were written by more competent people who spent more time working through the potential issues.
 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas Hauck wrote:Question:
Do synchronized collections provide higher performance than when working with two threads (without using java.util.concurrent)?

Is there an advantage of using the Concurrent Collections as opposed to using threads ?


The answer is Abstraction. While working with the business logic, you are most likely to focus on business rules rather than delving deep into synchronization details .
I feel all the high level constructs are developed using the low level constructs only and nothing new is being exploited at the OS level to make these classes better in performance.
But yes, as Paul said, these classes are well tested and there is no reason to not to use them.

Thanks !!!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!