1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
TiliK225 [7]
3 years ago
13

5.14 Describe how the compare and swap() instruction can be used to provide mutual exclusion that satisfies the bounded-waiting

requirement. (15 pts)
Computers and Technology
1 answer:
Naddik [55]3 years ago
8 0

Answer:

Explained below

Explanation:

Compare and Swap(C&S) is simply an atomic operation whereby the compare and swap operations are automatically executed.

Now compare and Swap basically needs 3 arguments namely:

- 2 old values which we will label X and Y

- 1 new value which is written in X that we will call Z

Thus, we now have; C & S = {X, Y, Z}

To explain this well, let X be a variable where X has a value of 7.

Now, if a programmer gives a program me that X be multiplied by 2,then what C&S operation will do is;

I) Y = X where Y is a new variable.

II) Result = C&S(X, Y, X*7)

Variable X is global and this means that mere than one process and more than 1 thread can see the variable X.

Now, if a process named P1 wants multiply the variable X by 7 using C&S operation, it will first make a local copy of variable X (which in this case is now the new variable Y). After that it will atomically compare X & Y and if they are equal, it will replace X with 10X.

However, if they are not equal, P1 will re-read value of X into Y and carry of C&S instruction again.

You might be interested in
How are natural systems and engineered systems similar to one another?
erastovalidia [21]

They get the idea from nature and then the make engineered systems.That is how they are similar.

4 0
3 years ago
Blogs differ from most other online text sources because they
allochka39001 [22]
Tell you what a person's life is like
4 0
3 years ago
Read 2 more answers
The mean life of a certain computer hard disk in continual use is 8 years. (a) How long a warranty should be offered if the vend
Allushta [10]

Answer:

a) 0.843 years

b) 1.785 years

Explanation:

See attached pictures for detailed explanation.

4 0
3 years ago
Jennifer turns on her laptop and hears a series of beeps. What do they probably indicate?.
telo118 [61]

Answer:

Bad Ram or CPU/GPU Problems

Explanation:

It depends on the motherboard used in the type of PC you'd have to look up the number of beeps and the time spread out to figure out your certain issue.

3 0
2 years ago
Difference between server and a client computer
maw [93]

Answer:

A server stores data for a client computer to access and use, and pretty self eplanitory for a client computer

Explanation:

5 0
3 years ago
Other questions:
  • The computers connected to the main server are called ______.
    14·2 answers
  • The waterfall model and spiral model are variations of SDLC. Do some research to find out what they are and explain how these mo
    14·1 answer
  • What is TRUE about the following array?
    15·1 answer
  • The total revenues for a company are $150,223 and the total expenses were 125,766. If you are calculating the net income, which
    10·1 answer
  • T F A stub is a dummy function that is called instead of the actual function it<br><br> represents.
    7·1 answer
  • What is WEB 1.0 to WEB3.0
    11·1 answer
  • In Python, if var1 = "Happy" and var2= "Birthday" and var3 = (var 1+var2) *2, then var3 stores the string
    6·1 answer
  • Managers looking for advice on properly dealing with obsolete technology hardware can: a) consult the e-Stewards program b) seek
    9·1 answer
  • Which 1898 film did George Melies create using camera trickery to create a illusion in which we now
    11·1 answer
  • Which of the following helps you plan out every step of an animation?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!