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
Len [333]
4 years ago
9

Considering the following algorithm, which of the following requirements are satisfied?

Computers and Technology
1 answer:
Alisiya [41]4 years ago
4 0

Answer:

b) Bounded Waiting

Explanation:

int currentThread = 1;

bool thread1Access = true;

bool thread2Access = true;

thread1 { thread2 {

While (true) {

                   While (true)

                                   {

                     while(thread2Access == true)

                                       {

                                      while(thread1Access == true)

                                       {

                                            If (currentThread == 2) {

                                              If (currentThread == 1)

                                                {        

                                                  thread1Access = false; thread2Access = false;

                                                  While (currentThread == 2);

                                                 While (currentThread == 1);

                                                  thread1Access = true; thread2Access = true;

} }

/* start of critical section */ /* start of critical section */

currentThread = 2 currentThread = 1

… ...

/* end of critical section */ /* end of critical section */

thread1Access = false; thread2Access = false;

… ...

} }

} }

} }

It can be seen that in all the instances, both threads are programmed to share same resource at the same time, and hence this is the bounded waiting. For Mutual exclusion, two threads cannot share one resource at one time. They must share simultaneously. Also there should be no deadlock. For Progress each thread should have exclusive access to all the resources. Thus its definitely the not the Progress. And hence its Bounded waiting.

You might be interested in
Python1. Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is a Stri
suter [353]

Answer:

Expression for 1st option:

last_character=name[len(name)-1]

print(last_character)

Expression for 2rd option:

length_of_the_string=len(sentence)

print(length_of_the_string)

            or

length=0

for x in sentence:

   length=length+1

print(length)

Expression for 3rd option:

last_character=name[len(name)-1]

print(last_character)

Explanation:

  • The first and the third questions option are same, so the answer to those options are also the same.
  • The len function is used in python which is used to find the length of the string.
  • The user can also find the string length by the help second option which is written in option 2 answers. It uses a for loop which scans the character and counts the length.
  • The len function defines the length and if any user needs to print the last character then he can do it with the help of string size -1.
  • It is because the string is a collection of character array which index starts from 0 and ends in size-1.
3 0
4 years ago
3. A vulnerability is: a. A hacker searching for open ports b. A known attack method c. An incorrectly implemented policy d. All
ELEN [110]

Answer:

A

Explanation:

A hacker searching for open ports denotes vulnerability of computer (to hacking).

Cheers

7 0
3 years ago
What formula would you enter to add the values in cells b4, b5, and b6?
Semenov [28]
=SUM(b4:b6)  If it doesn't show the $ sign just make sure it's in currency :)  I hope this helped!! Good Luck!!! :)
4 0
4 years ago
When a user stores data in "the cloud", the data is stored on the user's premise in what is called a "cloud server"?
bija089 [108]
I'm pretty sure that's false  :0
8 0
3 years ago
What does it mean by the term versatility in computer world ​
Mnenie [13.5K]

Answer:

Versatility refers to the capability of a computer to perform different kinds of works with same accuracy and efficiency.

3 0
3 years ago
Other questions:
  • #1. List examples of where it matters whether items are in order (sorted).
    10·1 answer
  • When at the rightmost cell in a row, press the ENTER key to move to the first cell in the next row; do not press the TAB key
    6·1 answer
  • Another name for a chart is “Matrix.” Is that true or False
    8·2 answers
  • What is the best explanation for why digital data is represented in computers in binary?
    10·1 answer
  • Assume a TCP segment consisting of 1500 bits of data and 160 bits of header is sent to the IP layer, which appends 120 bits of h
    14·1 answer
  • Which of the following is not part of the processes involved in data valida
    11·1 answer
  • Pls help help me is good help me helping is very good
    10·1 answer
  • What made the master so angry with his servant?​
    13·2 answers
  • Kyle has a notebook for each of his 5 classes. He puts 6 stickers on each notebook. There are 10 stickers on each sheet. How man
    11·2 answers
  • PLEASE HELP!! THIS IS DUE SOON.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!