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
Effective presentations vary the color scheme on each slide.<br><br> True<br> False
KengaRu [80]

Answer:

TRUE

Explanation:

7 0
3 years ago
Read 2 more answers
In a power point a type of chart that rather than showing numerical data illustrates a relationship or logical flow between diff
allochka39001 [22]

SmartArt is the answer here.

5 0
3 years ago
How long does it take to wire a house?
Licemer1 [7]

Answer:

the rewiring of an entire home may take up to a week. Smaller jobs, like wiring a single room, may take one to two days

Explanation:

4 0
3 years ago
Read 2 more answers
You can not give an exact size for a height for column width true or false
GalinKa [24]

Answer:

~false~

Explanation:

5 0
3 years ago
Assume we are using the simple model for floating-point representation as given in this book (the representation uses a 14-bit f
Artemon [7]

Answer:

The representation of 100.0 in the floating-point representation is computed as follows: First convert the given number 100.0 in the binary form. 10010 = 11001002 the binary representation.

Explanation:

3 0
2 years ago
Other questions:
  • A computer is made of up 6 main components: a) CPU (central processing unit)
    7·1 answer
  • Which social network site has 1.5 billion actives users per month?
    15·1 answer
  • A server would experience a __________ attack when a hacker compromises it to acquire information from it from a remote location
    13·1 answer
  • I love dog my is 16 weeks old how old is yours
    12·1 answer
  • Which of the following access control techniques allows the user to feel empowered and able to change security attributes?
    5·1 answer
  • 2. Select the things you can do when working with rows in columns in a spreadsheet:
    5·1 answer
  • Mha lovers why do other anime lovers report mha lovers for not liking there anime?
    6·2 answers
  • Match the feature to its function.
    7·1 answer
  • assume there are K sorted lists, each of n/k elements. We want to merge them into a single sorted list of n elements. Give an op
    7·1 answer
  • Carlos has become pretty efficient at using the Word Processor but he takes time to use the menu each time he saves, prints and
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!