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
Which of the following is not a property of a constructor?A. The name of a constructor can be chosen by the programmerB. A const
inna [77]

Answer:

The answer is "Option A"

Explanation:

The constructor is a special member function whose task is to initialize an object from its class, and it doesn't return any value like int, float, double, etc. Its name and class name will always be the same, and when we create the class object so, the constructor is automatically called, and it may be overloaded, that's why we can say that except the "choice A", all were correct.

4 0
3 years ago
According to the narrator of "EPIC 2015, in 2015, "news" is:
statuscvo [17]

Answer:

D created by apathetic journalists who care little how true a story is.

Explanation:

D

6 0
3 years ago
Read 2 more answers
Which web design concept is most closely related to elements that symbolize the real world? A. node B. landmark c.metaphor IN D.
sergij07 [2.7K]

Answer:

landmark

Explanation:

6 0
3 years ago
What is known as the global network of computers?
Rudik [331]

Answer:

b. internet

Explanation:

cuz just b

7 0
2 years ago
Read 2 more answers
Web maintenance plays a vital role in a website's development. It helps ensure the online presence of any website by performing
Nastasia [14]

Answer:

See the explanation section

Explanation:

A Website is something that is never truly complete. It needs to be maintained or updated on a regular basis. With a Website Maintenance, you ensure that your website is up to date regarding content, regular back ups, designs and secured against spam, harmful login attempts and viruses. A website that is updated and maintained regularly will prove more profitable in terms of gaining good rankings on search engines.

Key Benefits of a Website Maintenance include:

Security: keeping the software or code on your website updated helps to protect and keep it – and your site visitors – secure.

Increase your Web Presence:

Publishing press releases or articles work great in terms of maintaining and updating your website with new content and information. Search engines always favor content rich websites.

Cost Savings: Small issues and problems can be ignored before they add up. The final result can become a source of down time which can stop you from working and fixing the entire thing. If you always keep your business website updated and maintained on a regular basis there is a less chance that something drastic will go wrong, and cost you a large amount to fix.

Enhance your Credibility: If you receive any positive reviews and feedbacks from your customers, presenting them on your website is a great idea!

3 0
3 years ago
Other questions:
  • Who are some of my emails not all deleting on my android i have to use my laptop to see them to delete them?
    12·2 answers
  • 100 POINTS NEED ASAP PLEASE HELP
    8·2 answers
  • with the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
    10·2 answers
  • In the Word 2016 window, where is the Status bar located?
    11·1 answer
  • The part of the computer that contains the brain or the Central Park nursing unit is also known as
    10·1 answer
  • John works in the Sales and Marketing group. Why does his group need to interact with operations management to plan the launch o
    12·1 answer
  • To exit Access, click the ____ button on the right side of the Access title bar.
    9·1 answer
  • Johnny is a member of the hacking group Orpheus1. He is currently working on breaking into the Department of Defense's front end
    14·1 answer
  • Compared to other forms of communication, texting does not offer as many message cues.
    13·1 answer
  • Which tab automatically becomes available after inserting a text box? Drawing Tools Insert Text Box Tools Shape Tools
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!