Programmer's intuition means (i) that instructions execute in program order, and (b) that memory accesses are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
"Programmer's intuition" means (i) that instructions execute in program order, and (b) that memory accesses are atomic. (a) Assume two processors are executing following code. Initial values of vand u are zero. P1 al: v= 10; a2: v available = 1; a3: if (u_available == 1) print u; P2 a4: if (v_ available u = v*10; a5: u available = 1; a6: print v; == 1) For this part, do not assume that the instructions of P1 and P2 have to execute in order (e.g., a6 can be executed before a 4). What are all possible combinations for printing v and u? For each combination, state the sequence of instruction executions (e.g., ala2 a3 a4 a5 a6). (b) of the above results, which combination(s) of (v, u) is correct according to programmer's intuition? (c) The other results are impossible according to programmer's intuition. Which of the following is not followed in producing these results, program-order execution or atomicity of memory operations? "Programmer's intuition" means (i) that instructions execute in program order, and (b) that memory accesses are atomic. (a) Assume two processors are executing following code. Initial values of vand u are zero. P1 al: v= 10; a2: v available = 1; a3: if (u_available == 1) print u; P2 a4: if (v_ available u = v*10; a5: u available = 1; a6: print v; == 1) For this part, do not assume that the instructions of P1 and P2 have to execute in order (e.g., a6 can be executed before a 4). What are all possible combinations for printing v and u? For each combination, state the sequence of instruction executions (e.g., ala2 a3 a4 a5 a6). (b) of the above results, which combination(s) of (v, u) is correct according to programmer's intuition? (c) The other results are impossible according to programmer's intuition. Which of the following is not followed in producing these results, program-order execution or atomicity of memory operations?
Expert Answer:
Related Book For
Computer Architecture Fundamentals And Principles Of Computer Design
ISBN: 9781032097336
2nd Edition
Authors: Joseph D. Dumas II
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
MUST BE CORRECT ANSWERS A small software company has the following simplified cashflow, funded by shareholders' equity of 20,000 and a bank overdraft of 5000: Invoiced money received 2 months after...
-
The per-unit cost of an item is its average total cost (5 total cost/quantity). Suppose that a new cell phone application costs $100,000 to develop and only $.50 per unit to deliver to each cell...
-
Provide two examples of situations where the use of ROI can lead to decisions which may harm the future competitiveness of a company.
-
Exact Photo Service purchased a new color printer at the beginning of 2016 for $38,000. The printer is expected to have a four-year useful life and a $3,500 salvage value . The expected print...
-
Verify the integral obtained by Rayleigh and hence show that the velocity profile needs to have an inflexion point for instability. Show that a simple shear flow is stable. Hence viscosity is needed...
-
1. Speculate as to the purpose of the share swap between BP and Rosneft. 2. What is the purpose of the two-year lockup period during which neither partner can sell its stock? How might the lockup...
-
Your client want to have $168,313 in 20 years, how much money should he put in a savings account today? Assume that the savings account pays you 5.5 percent and it is compounded annually.
-
Poindexter claims that the real cheating occurs when we increase power by increasing the likelihood that results will be significant. He reasons that if we are more likely to reject H 0 , then we are...
-
Describe the Book/Tax Impact of each transaction:(Book to Tax Reconciliation) Brief Facts: Taxable Income for charitable contribution limitation purposes/ before any charitable contribution, NOL...
-
VR technology was developed decades ago; in fact, a computer engineer and author named Jeron Lanier coined the term virtual reality in 1987. That was two years after Lanier left his job at Atari to...
-
Explain the stages a company goes through as its management orientation evolves from domestic and ethnocentric to global and geocentric.
-
Explain how a nation can achieve competitive advantage, and list the forces that may be present in a national diamond.
-
It is a safe bet that most people reading this textbook are familiar with Red Bull. The $6.4 billion company that largely created the market for energy drinks revels in its association with cultural...
-
In November 2015, VW faced even more bad news. It was revealed that some three-liter, six-cylinder engines in cars produced by Audi, one of Volkswagen AGs luxury brands, also contained defeat...
-
To find the average molecular weight value (Mn) of a polymer with a known heterogeneity index of 2, 0.10 grams of polymer was dissolved in 100 mL cyclohexane and the flow time was found to be 140...
-
What are some of the various ways to implement an awareness program?
-
Compare and contrast program-controlled I/O, interrupt-driven I/O, and DMA-based I/O. What are the advantages and disadvantages of each? Describe scenarios that would favor each approach over the...
-
List and explain nine common characteristics of RISC architectures. In each case, discuss how a typical CISC processor would (either completely or partially) not exhibit the given attribute.
-
A computer system of interest has a CPU with a clock cycle time of 0.5 ns. Machine language instruction types for this system include integer addition/subtraction/logic instructions that require one...
-
According to research on ethics in the workplace, _________ is/are often a major and frequent source of pressures that create ethical dilemmas for people in their jobs. (a) declining morals in...
-
A business owner makes a decision to reduce a plants workforce by 10% in order to cut costs and be able to save jobs for the other 90% of employees. This decision could be justified as ethical using...
-
If a manager fails to enforce a late-to-work policy for all workersthat is, by allowing some favored employees to arrive late without penaltiesthis would be considered a violation of _________. (a)...
Study smarter with the SolutionInn App