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 7428415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:44:31+00:00 2026-05-29T08:44:31+00:00

Oracle’s documentation on atomic access (at http://docs.oracle.com/javase/tutorial/essential/concurrency/atomic.html ) says this: a volatile variable establishes

  • 0

Oracle’s documentation on atomic access (at http://docs.oracle.com/javase/tutorial/essential/concurrency/atomic.html) says this:

“a volatile variable establishes a happens-before relationship… . This means that … when a thread reads a volatile variable, it sees not just the latest change to the volatile, but also the side effects of the code that led up the change.”

I’m having trouble wrapping my head around that. I understand how volatile variables work (in >= Java 5), but I’m wondering how the java decides what side-affect “led up” to the change of a volatile variable.

So I guess my question is: What side-effects are given this guarantee?

EDIT:

So I’ve learned that if thread A modifies a volatile variable, and then thread B reads it, all writes from thread A that happened before the write to the volatile variable are “made coherent” with respect to thread B (ie the cached values of variables subject to the afore mentioned writes by thread A are invalidated in thread B). Correct me if I’m wrong.

  • 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-29T08:44:32+00:00Added an answer on May 29, 2026 at 8:44 am

    Most multiprocessor caches have coherency mechanisms, so the penalty isn’t as bad as flushing all the caches.

    Any writes in the thread that wrote to the volatile before doing so will be seen by the thread reading the volatile after having done so.

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

Sidebar

Related Questions

Oracle Java 7 has a list of certified platform http://www.oracle.com/technetwork/java/javase/config-417990.html#os popular server Operating systems
Oracle's Http Authentication page from the Java SE 6 documentation says that if you
Oracle describes the Easy Connect string as username@[//]host[:port][/service_name][:server][/instance_name] (from http://www.oracle.com/technology/products/oraclenet/files/OracleNetServices_NetEasyConnect.pdf ) However, some of
Oracle is giving me an error (ORA-00907: missing right parenthesis) when I run this
Oracle has this concept of allowing database users to be identified by the operating
In Oracle, we do this: def TNAME=&1 create table &TNAME (foo varchar(10)); How to
Reference:Oracle documentation Oracle Database enforces all PRIMARY KEY constraints using indexes Q's 1> I
Oracle's table server offers a built-in function, TRUNC(timestamp,'DY') . This function converts any timestamp
Oracle creates nicely HTML-formatted workload reports (AWR) that list things like instance statistics, wait
Oracle 10g DB. I have a table called s_contact . This table has a

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.