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

I am using java.util.logging to do all the logging of my application. Until recently,
Are there any annotations in java which mark a method as unsupported? E.g. Let's
In what circumstances can ClassCastException occur in the code below: import java.util.Arrays; import java.util.List;
Conventional wisdom tells us that high-volume enterprise java applications should use thread pooling in
I created a simple application that shows add using ad whirl .it does not
I have a problem using JPA with Oracle and grouping by hour. Here's the
I'm new to Java. I'm taking an online class this semester. The book which
I have Flex/Parsley/Blazeds application deployed on weblogic 9.x. The following error appears in the
I'm supposed to implement a bag data structure (also called a multiset), an unordered

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.