Question

In: Computer Science

Which of the following is true? Select one: a. No deadlock implies no starvation; b. Starvation...

Which of the following is true?

Select one:

a. No deadlock implies no starvation;

b. Starvation implies deadlock.

c. No starvation implies no deadlock;

d. Deadlock doesn’t imply starvation;

Which of the following indicates that Pi can enter the critical section in Peterson’s solution?

Select one:

a. flag[j] == true or turn == i

b. flag[j] == true and turn == j

c. flag[j] == false or turn == j

d. flag[j] == false or turn == i

Assume the binary variable lock is initialized to be 0, which of the following can be an implementation of the entry section to solve the critical-section problem?

Select one:

a. none of the other answers

b. both A and B

c. while (test and set(&lock)), do nothing;

d. while (compare and swap(&lock, 0, 1) != 0), do nothing;

Under which of the following contention loads does traditional synchronization become faster than CAS-based synchronization?

Select one:

a. none of the other answers

b. high contention

c. moderate contention

d. uncontended

Which of the following is NOT true regarding conditional variable, e.g. x?

Select one:

a. The x.signal() operation resumes exactly one suspended process

b. x.wait() means that the process invoking this operation is suspended until another process invokes x.signal()

c. If no process is suspended, then the signal() operation still affects the state of the semaphore

d. The only operations that can be invoked on a condition variable are wait() and signal()

Solutions

Expert Solution

Which of the following is true?

Select one:

a. No deadlock implies no starvation; -- TRUE

b. Starvation implies deadlock. -- FALSE

c. No starvation implies no deadlock; -- FALSE

d. Deadlock doesn’t imply starvation; --- FALSE


explanantion: deadlock implies starvation but starvation doesn't imply deadlock and if there is no dead lock there wont be any stravtion.


Which of the following indicates that Pi can enter the critical section in Peterson’s solution?


b. flag[j] == true and turn == j   

explanantion:

if there are two processes p1 and p2

p1:

wants to set the tunr to true
trun changed to true
and then result comes back as false as there are no busy waiting


p2:
in mean while
p2 want to set the turn to true
but it reieceve result true as p1 set to true
p2 keeps waiting until p1 leaves

************************************************************************************************************************
Assume the binary variable lock is initialized to be 0, which of the following can be an implementation of the entry section to solve the critical-section problem?

Select one:
a. none of the other answers

explanation:

beacuse both c and d are correct
c. while (test and set(&lock)), do nothing;
d. while (compare and swap(&lock, 0, 1) != 0), do nothing;

this type od implementation is called mutal exlustion

************************************************************************************************************************


Under which of the following contention loads does traditional synchronization become faster than CAS-based synchronization?

Select one:

d. uncontended

explanation:

atomic instructions makes CAS slow than traditional when thereis
no contection

************************************************************************************************************************


Which of the following is NOT true regarding conditional variable, e.g. x?

Select one:

a. The x.signal() operation resumes exactly one suspended process--TRUE

b. x.wait() means that the process invoking this operation is suspended until another process invokes x.signal()---TRUE

c. If no process is suspended, then the signal() operation still affects the state of the semaphore---FALSE

d. The only operations that can be invoked on a condition variable are wait() and signal() ---TRUE


Related Solutions

Which of the following is / are not true about Securitization: - Select one: a. It...
Which of the following is / are not true about Securitization: - Select one: a. It is process by which receivables are converted into securities b. It is process by which collateral securities are given by borrowers to financial institutions for loan c. It is a process by which default risk is transferred to third parties d. It is a process in which SPV plays the vital role.
1)Which of the following will be expected to be activated during times of prolonged starvation? (select...
1)Which of the following will be expected to be activated during times of prolonged starvation? (select all correct answers) Gluconeogenesis in kidney Lipogenesis in liver Ketogenesis in liver Lipolysis in adipose Glycogenesis in muscle Ketone utilization in brain 2)Which of the following is a description of re-purposing drugs for treatment of inborn errors of metabolism? (select one) Use of an antisense oligonucleotide such as mipomersen that inhibits production of a toxic protein Using proteostatis regulators to increase the production of...
Which one of the following statements is NOT true? Select one: A. The need for funding...
Which one of the following statements is NOT true? Select one: A. The need for funding does not end when a company goes public. B. Approval is obtained from the board of directors to issue securities. C. The lowest-cost source of external funds is often an open offer to the public. D. The investment bank decides how much money the company needs to raise and what type of security - such as debt, ordinary shares or preference shares - to...
Which of these statements about deadlock are true? (list all that are true.) a. If all...
Which of these statements about deadlock are true? (list all that are true.) a. If all transactions use two-phase locking, they cannot deadlock. b. Once two transactions deadlock, one of them must be aborted to maintain correctness. c. Systems that support update locks (S, X and U modes) cannot deadlock. d. Validation based concurrency control schemes cannot deadlock.
In terms of resources, what is the difference between deadlock and starvation? max 200 words
In terms of resources, what is the difference between deadlock and starvation? max 200 words
1.Which of the following is TRUE? Select one: a. Hemoglobin binds oxygen. b. Red blood cells...
1.Which of the following is TRUE? Select one: a. Hemoglobin binds oxygen. b. Red blood cells have a nucleus. c. The plasma in blood is bright red. d. Red blood cells are derived from leukocytes. e. Red blood cells and white blood cells arise from different stem cells found in bone marrow. 2. The inflammatory response is an example of a type of physical barrier that provides immune defense. Select one: True False
Which of the following is true of Software as a Service? Select one: a. It requires...
Which of the following is true of Software as a Service? Select one: a. It requires an organization to maintain and develop the software. b. It requires the installation of specialized interfaces at the client end. c. It involves fixed monthly and yearly costs for the services. d. It is not scalable in response to large increases in demand. e. It allows clients to access services on an as-needed basis.
Q14 Which of the following is not true for a private company? Select one: a. It...
Q14 Which of the following is not true for a private company? Select one: a. It is a common form of business structure for large-sized entities. Q24 The triple bottom line approach encourages a focus on which performance areas? Select one: a. Economic, environmental and sustainability b. Economic, social and environmental c. Social, environmental and sustainability d. Economic, social and sustainability b. The company name includes the words 'Pty Ltd'. c. It can have up to 50 shareholders. d. It...
Which of the following is true of annuities? Select one: a. An ordinary annuity is an...
Which of the following is true of annuities? Select one: a. An ordinary annuity is an equal payment paid or received at the beginning of each period. b. An annuity due is a payment paid or received at the beginning of each period that increases by an equal amount each period. c. An ordinary annuity is an equal payment paid or received at the end of each period that increases by an equal amount each period. d. An annuity due...
1. Which of the following statements are true? Select all that apply. Select one or more:...
1. Which of the following statements are true? Select all that apply. Select one or more: a. Earnings per share is calculated by dividing retained earnings by the number of shares of common stock outstanding. b. The creditors of a firm must be satisfied before any earnings can be distributed to the common shareholders. c. When referring to ratio comparisons, time-series analysis compares a firm to that of an industry leader. d. The operating profit margin must take into account...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT