Operating Systems - Chapter 5

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

When mutex lock is implemented as a binary semaphore, what should its value be initialized to be? A. 0 B. 1 C. -1 D. none of the above

B. 1

Which of the following is true for the solutions to critical-section problems? A. No deadlock implies progress, and progress implies bounded waiting B. Bounded waiting implies progress, and progress implies no deadlock C. Progress implies no deadlock, and no deadlock implies bounded waiting D. Bounded waiting implies no deadlock, and no deadlock implies progress

B. Bounded waiting implies progress, and progress implies no deadlock

A mutex lock is released immediately after entering a critical section. A. True B. False

B. False

CAS-based synchronization is always faster than traditional synchronization. A. True B. False

B. False

Mutex locks and counting semaphores are essentially the same thing. A. True B. False

B. False

The value of a counting semaphore can range only between 0 and 1. A. True B. False

B. False

When the mutex lock is implemented based on a binary semaphore, it should be initialized to be 0. A. True B. False

B. False

In _________, the process may be changing common variables, updating a table, writing a file, and so on. A. entry section B. critical section C. exit section D. remainder section

B. critical section

Which of the following critical-section problem's requirements ensures programs will cooperatively determine what process will next enter its critical section? A. mutual exclusion B. progress C. bounded waiting D. none of the above

B. progress

Which of the following is true? A. No deadlock implies no starvation; B. No starvation implies no deadlock; C. Deadlock doesn't imply starvation; D. Starvation implies deadlock.

C. Deadlock doesn't imply starvation;

Which of the following statements is true? A. A counting semaphore can never be used as a binary semaphore. B. A binary semaphore can never be used as a counting semaphore. C. Spinlocks can be used to prevent busy waiting in the implementation of semaphore. D. Counting semaphores can be used to control access to a resource with a finite number of instances.

C. Spinlocks can be used to prevent busy waiting in the implementation of semaphore.

Which of the following actions should be performed among cooperating processes? A. process synchronization B. coordination C. both of the above D. none of the above

C. both of the above

Which of the following is true for race condition? A. race condition occurs where several processes access and manipulate the same data concurrently B. when race condition occurs, the outcome of the execution depends on the particular order in which the access takes place C. both of the above D. none of the above

C. both of the above

Which of the following critical-section problem's requirements limits the amount of time a program will wait before it can enter its critical section? A. mutual exclusion B. progress C. bounded waiting D. none of the above

C. bounded waiting

Which of the following is true regarding the requirements for the solutions to critical-section problem? A. mutual exclusion implies progress B. progress implies bounded waiting C. bounded waiting implies progress D. none of the above

C. bounded waiting implies progress

Under which of the following contention loads does traditional synchronization become faster than CAS-based synchronization? A. uncontended B. moderate contention C. high contention D. none of the above

C. high contention

The counting semaphore is initialized to ___________. A. 0 B. 1 C. the number of resources available D. none of the above

C. the number of resources available

What is the correct order of operations for protecting a critical section using a binary semaphore? A. release() followed by acquire() B. acquire() followed by release() C. wait() followed by signal() D. signal() followed by wait()

C. wait() followed by signal()

Which of the following are efforts to towards developing scalable, efficient tools that address the demands of concurrent programming? A. designing compilers that generate more efficient code B. developing languages that provide support for concurrent programming C. improving the performance of existing libraries and APIs D. all of the above

D. all of the above

Which of the following may cause a liveness failure? A. an infinite loop B. a busy waiting loop C. a deadlock D. all of the above

D. all of the above

Assume count is a variable name, which of the following operations is atomic? A. count++ B. count-- C. both of the above D. none of the above

D. none of the above

Which of the following is NOT true regarding semaphore implementation? A. It suffers from the busy waiting problem B. Semaphore has a waiting queue associated with the semaphore C. When a process executes the wait() operation and finds that the semaphore value is not positive, it will suspend itself D. A process that is suspended, waiting on the semaphore, should be restarted when some other process executes a signal() operation.

A. It suffers from the busy waiting problem

Which of the following is NOT true? A. Since semaphore and mutex lock are tools for synchronization, process that have used semaphores or mutex locks should not cause deadlocks B. Semaphores and mutex locks may be shared resources that difference processes contend for, and hence deadlocks may occur C. a set of processes is in a deadlocked state when every process in the set is waiting for an event that can be caused only by another process in the set D. all of the above

A. Since semaphore and mutex lock are tools for synchronization, process that have used semaphores or mutex locks should not cause deadlocks

A semaphore has an integer value. A. True B. False

A. True

Bounded waiting implies progress, and progress implies mutual exclusion. A. True B. False

A. True

Mutex lock variable is binary. A. True B. False

A. True

Race conditions can result in corrupted values of shared data. A. True B. False

A. True

Semaphore implementation overcomes the busy waiting problem. A. True B. False

A. True

Semaphores and mutex locks both provide mutual exclusion. A. True B. False

A. True

Solutions to the critical section problem may suffer from liveness failures. A. True B. False

A. True

Spinlocks are not appropriate for single-processor systems. A. True B. False

A. True

The preemptive kernel is more suitable for real-time programming than non-preemptive kernel. A. True B. False

A. True

The preemptive kernel may be more responsive than non-preemptive kernel. A. True B. False

A. True

In _________, the process requests permission to access and modify variables shared with others. A. entry section B. critical section C. exit section D. remainder section

A. entry section

Which of the following regarding mutex lock is NOT true? A. mutex lock is a hardware solution to critical-section problem B. mutex lock is a higher-level software solution to critical-section problem C. mutex lock suffers from busy waiting D. the general rule of thumb is to use a mutex lock if the lock will be held for a duration less than two context switches

A. mutex lock is a hardware solution to critical-section problem

Which of the following critical-section problem's requirements ensures only one process is active in its critical section at a time? A. mutual exclusion B. progress C. bounded waiting D. none of the above

A. mutual exclusion


Kaugnay na mga set ng pag-aaral

Chapter 6: Markets & Social Security

View Set

Your Rights: Trials and Punishments

View Set

Chapter 6: Introduction to Vectors

View Set

Chapter 11 - Performance Appraisals

View Set

Pharm 2 Exam 4 Practice Questions

View Set

Ch 11 health problems of the infant

View Set

Case 1 Study - IB Business Management

View Set