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

  • Home
  • SEARCH
  • 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 3315096
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:18:35+00:00 2026-05-17T22:18:35+00:00

When using any of the java.util.concurrent classes, do I still need to synchronize access

  • 0

When using any of the java.util.concurrent classes, do I still need to synchronize access on the instance to avoid visibility issues between difference threads?

Elaborating the question a bit more

When using an instance of java.util.concurrent, is it possible that one thread modify the instance (i.e., put an element in a concurrent hashmap) and a subsequent thread won’t be seeing the modification?

My question arises from the fact that The Java Memory Model allows threads to cache values instead of fetching them directly from memory if the access to the value is not synchronized.

  • 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-17T22:18:36+00:00Added an answer on May 17, 2026 at 10:18 pm

    On the java.util.concurrent package Memory Consistency Properties, you can check the Javadoc API for the package:

    The methods of all classes in
    java.util.concurrent and its
    subpackages extend these guarantees to
    higher-level synchronization. In
    particular:

    • Actions in a thread prior to placing an object into any
      concurrent collection
      happen-before actions subsequent to the access or removal of that
      element from the collection in
      another thread.
      […]
    • Actions prior to “releasing” synchronizer methods such as
      Lock.unlock, Semaphore.release, and
      CountDownLatch.countDown
      happen-before actions subsequent to a successful “acquiring” method
      such as Lock.lock,
      Semaphore.acquire, Condition.await,
      and CountDownLatch.await on the
      same synchronizer object in another
      thread.
      […]

    So, the classes in this package make sure of the concurrency, making use of a set of classes for thread control (Lock, Semaphore, etc.). This classes handle the happen-before logic programmatically, i.e. managing a FIFO stack of concurrent threads, locking and releasing current and subsequent threads (i.e. using Thread.wait() and Thread.resume(), etc.

    Then, (theoretically) you don’t need to synchronize your statements accessing this classes, because they are controlling concurrent threads access programmatically.

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

Sidebar

Related Questions

Using Java, Is there a quick way to convert an alpha-2 country code (IN
When I change any .java file and build, the compilation takes 16 seconds. I
One of the lines in a java file I'm trying to understand is as
Using: select name, id from TEST where id :2 AND name :1 order by
Can any body tell me what this exception means, its confusing because I tried
I have read other related posts, but am still not quite sure how, or
I am trying to learn how to import from XML to JTable. I am
I am writing an application where i have to interact with MS SQL database.
I've got a trait that looks like this (some further information can be found
I'm trying to connect to a website (source code below) that requires login and

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.