Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3443500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:47:57+00:00 2026-05-18T08:47:57+00:00

The JDK ships with CopyOnWrite* implementations for Set and List , but none for

  • 0

The JDK ships with CopyOnWrite* implementations for Set and List, but none for Map and I’ve often lamented this fact. I know there are other collections implementations out there that have them, but it would be nice if one shipped as standard. It seems like an obvious omission and I’m wondering if there was a good reason for it. Anyone any idea why this was left out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:47:57+00:00Added an answer on May 18, 2026 at 8:47 am

    I guess this depends on your use case, but why would you need a CopyOnWriteMap when you already have a ConcurrentHashMap?

    For a plain lookup table with many readers and only one or few updates it is a good fit.

    Compared to a copy on write collection:

    Read concurrency:

    Equal to a copy on write collection. Several readers can retrieve elements from the map concurrently in a lock-free fashion.

    Write concurrency:

    Better concurrency than the copy on write collections that basically serialize updates (one update at a time). Using a concurrent hash map you have a good chance of doing several updates concurrently. If your hash keys are evenly distributed.

    If you do want to have the effect of a copy on write map, you can always initialize a ConcurrentHashMap with a concurrency level of 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just noticed that JDK contains src.zip with a set of java files. I checked
This is Sun JDK 1.6u21, x64. I have a class for the purpose of
I have downloaded the java JDK but I am unable to run the program.
I do most of my work against JDK 1.5 - but occasionally I have
I upgraded to JDK 6 build 22 on Snow Leopard and now I cannot
Our web application is JDK 1.5 compliant, and is running succesfuly on WebSphere 6.1
I installed JDK 7 and Eclipse 3.6M6 . Then, I added JRE 7 as
I have a Java program (running in JDK 1.5 for now) which is getting
I'm trying to add a custom JDK to Netbeans 6.9.1 on OSX 10.6.5. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.