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

i know that the JDK consists of all java packages .But what does the
I have installed JDK. but while installing SDK it is showing there is no
Is there in the JDK or Jakarta Commons (or anywhere else) a method that
Where to set the JDK to be used by the SunOne server on Solaris?
Is there a native JDK code to copy files(buffers, streams, or whatever)?
Java JDK or JRE or both are specifications? Can anyone quote some relevant implementations?
I know JDK 1.5 pretty well. As we all know, besides new API (such
The sun jdk implementation looks like this: return v != v; Can anyone explain
I have installed latest JDK (x64) on Windows 7 but browsers still can't run
My current JDK on Mac OS (10.6) is set to 1.6 and I'd like

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.