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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:32:45+00:00 2026-05-26T07:32:45+00:00

My book presents a simple example which I’m a bit confused about: It says,

  • 0

My book presents a simple example which I’m a bit confused about:

It says, “consider the following program, and assume that the fine-grained atomic actions are reading and writing the variables:”

int y = 0, z = 0;
co x = y+z; // y=1; z=2; oc;

“If x = y + z is implemented by loading a register with y and then adding z to it, the final value of x can be 0,1,2, or 3. “

2? How does 2 work?

Note: co starts a concurrent process and // denote parallel-running statements

  • 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-26T07:32:46+00:00Added an answer on May 26, 2026 at 7:32 am

    In your program there are two parallel sequences:

    Sequence 1: x = y+z;

    Sequence 2: y=1; z=2;

    The operations of sequence 1 are:

    1. y Copy the value of y into a register.
    2. + z Add the value of z to the value in the register.
    3. x = Copy the value of the register into x.

    The operations of sequence 2 are:

    1. y=1; Set the value of y to 1.
    2. z=2; Set the value of z to 2.

    These two sequences are running at the same time, though the steps within a sequence must occur in order. Therefore, you can get an x value of ‘2’ in the following sequence:

    1. y=0
    2. z=0
    3. y Copy the value of y into a register. (register value is now ‘0’)
    4. y=1; Set the value of y to 1. (has no effect on the result, we’ve already copied y to the register)
    5. z=2; Set the value of z to 2.
    6. + z Add the value of z to the value in the register. (register value is now ‘2’)
    7. x = Copy the value of the register into x. (the value of x is now ‘2’)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The book says about a small Windows.Forms program The Windows Forms classes are in
Does anyone know any site or book that presents problems like python challenge ,
A) Book I’m learning from says that if we handle Login.Authenticate event, then we
I am building a simple book check out application. One of the things that
The book that I purchased to help with my SSIS understanding seems to have
Q1 Book suggests that before we register new SqlProfileProvider , we should remove any
The book, Producing Open Source Software , suggests that it's better to have lengthy
If Book aggregates Chapter which in turn aggregates Page, then what should be the
Anyone know a good book or post about how to start in EF? I
I need to write a clause into my xslt that says if an element

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.