Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) Write the assembly code to implement an atomic compare&swap using load-linked and store-conditional. Compare&swap (r1,r2,x) works as follows: Typically r1 is O (for unlocked)

image text in transcribed
(a) Write the assembly code to implement an atomic compare&swap using load-linked and store-conditional. Compare&swap (r1,r2,x) works as follows: Typically r1 is O (for unlocked) and r2 is 1 (for locked) 1. If (r1 = MEMIx)) then { r2 = MEM[x] MEM[x] = r2 FYI: atomic swap is implemented in some systems (e.g., IBM POWER and Intel x86). (b) Test-and-set incurs high traffic while spin waiting. What happens to compare&swap? (a) Write the assembly code to implement an atomic compare&swap using load-linked and store-conditional. Compare&swap (r1,r2,x) works as follows: Typically r1 is O (for unlocked) and r2 is 1 (for locked) 1. If (r1 = MEMIx)) then { r2 = MEM[x] MEM[x] = r2 FYI: atomic swap is implemented in some systems (e.g., IBM POWER and Intel x86). (b) Test-and-set incurs high traffic while spin waiting. What happens to compare&swap

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

What are the different techniques used in decision making?

Answered: 1 week ago