• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Java Concurrency - Any Advantages

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Sheriff
Posts: 27522
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic