Home / Expert Answers / Computer Science / question-11-pts-a-race-condition-can-occur-group-of-answer-choices-only-if-the-outcome-o-pa780

(Solved): Question 11 pts A race condition can occur _______. Group of answer choices only if the outcome o ...



Question 11 pts A race condition can occur _______. Group of answer choices only if the outcome of execution does not depend on the order in which instructions are executed when several threads try to access and modify the same data concurrently when several threads read the same data concurrently Flag question: Question 2 Question 21 pts A(n) _______ refers to the section of the code which is accessing data that may be modified by another process executing concurrently. Group of answer choices remainder section critical section entry section Flag question: Question 3 Question 31 pts _________ is the requirement that if a process is in its critical section, no other processes can be in their critical sections at the same time. Group of answer choices Mutual exclusion Progress Bounded waiting Flag question: Question 4 Question 41 pts In Peterson's solution, the _______ variable indicates if process i is ready to enter its critical section. Group of answer choices flag[i] turn lock Flag question: Question 5 Question 51 pts What best explains why Peterson's solution does not solve the critical section problem on modern computer architectures? Group of answer choices Modern computer architectures may reorder instructions. Peterson's solution does not preserve the bounded waiting requirement. Flag question: Question 6 Question 61 pts If lock = 0, the function call compare_and_swap(&lock,0,1) sets lock to ____ and returns _____. Group of answer choices 0, 1 1, 0 1, 1 0, 0 Flag question: Question 7 Question 71 pts A(n) _________ instruction ensures that all loads and store operations are completed before additional load and store operations are performed. Group of answer choices atomic variable memory memory barrier Flag question: Question 8 Question 81 pts A mutex lock _______. Group of answer choices is another term for a boolean variable is not guaranteed to have atomic operations can be used to solve the critical section problem Flag question: Question 9 Question 91 pts What is the correct order of operations for protecting a critical section using mutex locks? Group of answer choices acquire() followed by release() Setting the lock to true followed by setting the lock to false release() followed by acquire() Flag question: Question 10 Question 101 pts What is the best scenario for implementing a mutex lock as a spinlock? Group of answer choices On a multi-core system where the lock is held for a long duration. On a single-core system where the lock is held for a short duration. On a multi-core system where the lock is held for a short duration. Flag question: Question 11 Question 111 pts To use a binary semaphore to solve the critical section problem, the semaphore must be initialized to 1 and _____ must be called before entering a critical section and _____ must be called after exiting the critical section. Group of answer choices wait(), signal() Mutex locks - not semaphores - are used to solve the critical section problem. signal(), wait() Flag question: Question 12 Question 121 pts A semaphore ________ . Group of answer choices is not guaranteed to have atomic operations contains an integer value Uses the same acquire() and release() operations as a mutex lock. Flag question: Question 13 Question 131 pts Which of the following statements are false? Group of answer choices Semaphores are equivalent to mutex locks. Semaphores can be used to control access to a finite number of resources. Semaphores can be used to solve the critical section problem. Flag question: Question 14 Question 141 pts A monitor ________ . Group of answer choices allows multiple threads to be active within the monitor at the same time represents programmer-defined data and a set of functions that provide mutual exclusion is similar to a semaphore Flag question: Question 15 Question 151 pts A process that calls the wait() function on a condition variable is blocked ________. Group of answer choices only if at least 1 other process has also called wait() on the condition variable until another process calls signal() on the condition variable only if another process is active in the monitor



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe