• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 28326
96
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 !!!
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic