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
Que son los sistemas de control con retroalimentacion
iren2701 [21]
Existen 2 clases comunes:
sistema de lazo abierto: la salida no efecto sobre el sistema
sistema de lazo cerrado: la toma de desiciones del sistema de la entrada si no también de la salida
5 0
3 years ago
10. Which of these is not an HTTP verb? PUT AJAX GET DELETE
Korolek [52]

Answer:

Brainliest!

Explanation:

The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. There are a number of other verbs, too, but are utilized less frequently.

-

restapitutorial

.

com

3 0
3 years ago
The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
Feliz [49]

Answer:

Light text on a dark background

Explanation:

Microsoft PowerPoint is an application software in which the company ables to introduce themselves by making slides and presented to an audience in an easy and innovative way. In this,  we can add pictures, sound, video by adding the different text, colors, backgrounds, etc

For memorable and professional presentations, the light text on a dark background is a best combination as it is easy to read and give the best view of the message you want to convey.

8 0
3 years ago
In the last two decades, how have cameras evolved?
Artist 52 [7]

Answer:

The Changes to Camera Technology over the last 70 years. The technology that the modern camera is based on was created several hundred years ago. ... The company would then reload the camera with new film and send it back to the consumer so they could take more pictures with it.

Explanation:

8 0
3 years ago
Read 2 more answers
Write an assembly code to implement the y=(x1+x2)*(x3+x4) expression on 2-address machine, and then display the value of y on th
Ratling [72]

mbly code to implement the y=(x1+x2)*(x3+x4) expression on 2-address machine, and then display the value of y on the screen. Assume that the values of the variables are known. Hence, do not worry about their values in your code.

The assembly instructions that are available in this machine are the following:

Load b, a Load the value of a to b

Add b, a Add the value of a to the value of b and pla

7 0
3 years ago
Other questions:
  • Why are prepositions, conjunctions, and pronouns usually considered poor choices to use as key words?
    5·2 answers
  • What is the definition of a WAP?
    6·2 answers
  • Which of these expressions evaluates to 4.0?
    12·2 answers
  • Florida Highway Safety and Motor Vehicles reported blank of traffic fatalities were alcohol-related in Florida in 2009.​
    8·1 answer
  • Why are ethics important in PR?
    8·1 answer
  • java Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins w
    11·1 answer
  • Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0
    9·1 answer
  • What is the main difference between weathering, erosion and leaching​
    9·1 answer
  • Because travel distance, cost of living, and other factors vary among the three regions, the annual cost of having a salesperson
    14·1 answer
  • What does the 7 C s stand in communication skill​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!