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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:57:08+00:00 2026-05-24T22:57:08+00:00

Here, in this example, I’m assuming that we’re on a X86 system with at

  • 0

Here, in this example, I’m assuming that we’re on a X86 system with at least two physical cores and thread #1 and #2 is running on it’s own CPU core (true parallelism):

[initial state]
shared_memory_location = 0;

[thread #1]
shared_memory_location = 1;
signal();

[thread #2]
wait_for_signal();
print(shared_memory_location);

What’s the value of shared_memory_location on thread #2?

This is my take on this: It could have been either 0 or 1 but the consistency model of X86 ensures that any read after a memory location write will read the new value regardless of which CPU core this read is occurring on.

The X86 consistency model will ensure that the second physical core executing thread #2 doesn’t pick up an invalid value from the CPU core private cache. X86 makes this a lot easier but there’s no guarantees that any other system such as ARM will behave in this way.

If you didn’t have the consistency model of X86 how would you ensure that thread #2 was able to read the new value when it is signaled from thread #1?

…or more to the point, how do you hand of a value to a thread which is waiting on a signal in a correct manner?

DISCLAIMER: I could be completely wrong about the X86 consistency model, please correct me if I am!

  • 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-24T22:57:09+00:00Added an answer on May 24, 2026 at 10:57 pm

    If the signal() and wait_for_signal() methods calls memory barrier internally, then the scenario you describe will not occurs even on ARM, because of the memory barrier call flushes the data to the main memory instead of private core cache, i.e at the signal method it will flushes the data to main memory, so the shared_memory_location will be “volatile write”, and it will also flushes the data to to the main memory after the wait_for_signal, so reading shared_memory_location will be “volatile read”.

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

Sidebar

Related Questions

Here is an example that a forum poster gave, I can't tell if this
Here's an example: Double d = (1/3); System.out.println(d); This returns 0, not 0.33333... as
It is valid JavaScript to write something like this: function example(x) { Here is
Just using this as an example... Here are the columns in my UserProfile table:
This problem is not readily reproducible in a simple example here but was wondering
Here is a (big) example of the massive problem I am having, when this
The fictional example here. Suppose I designed a class named IODevice. This class already
This is often situation, but here is latest example: Companies have various contact data
What does this do? I find the example here, but other than what it
So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html Here is the example: <definition name=myapp.homepage template=/layouts/classic.jsp> <put-attribute name=title

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.