You are on page 1of 11

MIDTERM EXAMINATION #02 (TEST ID # 01)

OPERATING SYSTEM CONCEPTS


03-60-330-01 Winter 2012

UNIVERSITY OF WINDSOR SCHOOL OF COMPUTER SCIENCE


All questions are Multiple Choice or True/False. In each Multiple Choice question, 4 or 3 responses are provided you are to choose only one response which best answers the question. Use the Scantron sheet provided to indicate your answers. Circle the letter A, B, C or D (one only). For True/False types of questions, circle either A or B. If an error is made you must carefully erase the error and then fill in the circle you intend to choose. USE PENCIL ONLY ON THE SCANTRON SHEET 1. _______ takes a particular predetermined workload and defines the performance of each method for that workload. A) Queueing model B) Deterministic modeling C) Aging D) Real-time scheduling

2. Several processes access and manipulate the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called a(n) ____________________ . A) Shared memory segments B) Race condition C) Entry section D) Process synchronization

3. Cooperating processes can A) Only share a logical address space directly that is, both code and data B) Access concurrently to shared data may result in data consistency C) Either directly share a logical address space or be allowed to share data only through files or messages D) None of these responses are correct.

4. Monitors provide the synchronization mechanism for ____________________. A) Concurrency-control scheme B) Sharing abstract data types C) Blocking a condition variable D) All of the above

5. A solution to the critical section problem must satisfy which requirements? A) Bounded waiting, monitor and relative speed B) Semaphores, monitor and prevention of deadlock C) Signal, wait and continue D) Mutual exclusion, progress and bounded waiting

6. Petersons solution to the critical-section problem A) Only satisfies mutual exclusion and progress requirements B) Is a hardware synchronization using locks C) Is a software-based solution D) All of the above

7. It is not possible to have a deadlock involving only a single process. Why? A) This holds mutual exclusion, hold-and-wait and non-preemption B) This follows directly from the hold-and-wait condition C) Because single process not always in safe state D) None of the above

8. A deadlocked state occurs when two or more processes are waiting indefinitely for an event that can be A) occurred only by an I/O event B) happened by one of the ready processes C) caused only by one of the waiting processes D) caused only by a circular wait

9. A process must be holding at least one resource and waiting to acquire additional resources that are currently being held by other processes is called a(n) ______. A) deadlock state B) starvation C) circular wait D) hold and wait

10. An unsafe state always leads to a deadlocked state. A) True B) False 11. Which of the following statement is true for Bankers algorithm? A) A deadlock prevention scheme B) Can allocates multiple instances of each resource type C) More efficient than the resource-allocation-graph scheme D) A and C

12. If pre-emption is required to deal with deadlocks, then which statement must be addressed? A) Preempt one process at a time until the deadlock cycle is eliminated B) Preempt all deadlocked processes regardless of their cost and benefits C) Select a victim process to be preempted with minimum cost; must roll back the process to safe state and restart; ensure starvation will not occur. D) A and B

13. Base register holds the _________________. A) Smallest legal logical memory address B) Smallest legal physical memory address C) Lowest order logical memory address D) None of the above 14. Paging is a memory management scheme that ___________________. A) Permits the logical address space of a process to be noncontiguous B) Avoids external fragmentation and the need for compaction C) Solves the considerable problem of fitting memory chunks of fixed sizes onto the backing store D) All of the above

15. In a time-sharing environment, consider a system that supports 25 users each using a common text editor of size 110 KB and 35KB of data space for each user. What is the total space required for shared paging scheme? A) 3625 KB B) 2750 KB C) 985 KB D) 1085 KB

16. In a system, necessary conditions to arise a deadlock situation if A) Any one of mutual exclusion, progress and bounded waiting occurs B) Resource-allocation graph has cycles C) Hold simultaneously mutual exclusion, hold-and-wait, non-preemption and circular wait D) None of the above 17. In order to solve the critical section problem it is necessary to satisfy the condition that ________. A) A thread may be executing in its critical section if another thread is currently executing in its critical section. B) Only those threads that are executing in their critical sections can participate in the decision on which process will enter its critical section next. C) A bound must exist on the number of times that other threads are allowed to enter their critical state after a thread has made a request to enter its critical state. D) All of the above.

18. _______ refers to the situation where, for a set of processes, every process in the set must be waiting for an event that can be caused only be another process in the set. A) Deadlock B) Starvation C) Locking D) Blocking

19. In a system resource-allocation graph, ____. A) a directed edge from a process to a resource is called an assignment edge B) a directed edge from a resource to a process is called a request edge C) a directed edge from a process to a resource is called a request edge D) None of the above

20. Race conditions are prevented by requiring that critical regions be protected by ________ . A) B) C) D) clocks semaphores locks monitors

21. One way to ensure that a circular-wait condition never holds is to _________ ? A) apply a deadlock detection algorithm. B) impose a total ordering of all resource types and to require that each process requests resources in an increasing order of enumeration. C) assign each resource type a unique integer number to distinguish those occurring at the same time in the ordering. D) None of these responses is correct.

22. Which of the following statements is true? A) A safe state is a deadlocked state. B) An unsafe state may lead to a deadlocked state. C) An unsafe state is necessarily, and by definition, always a deadlocked state. D) A safe state may lead to a deadlocked state. 23. The circular-wait condition for a deadlock implies the hold-and-wait condition A) True B) False

24. A system has two types of resources, R1 and R2, both of which have two instances of their respective resource types. There are four processes competing for resources. Assume that the following system state exists: P1 : R1 is requested, R2 is allocated P2 : R1 is allocated P3 : R1 is allocated, R2 is requested P4 : R2 is allocated The system state _______ . A) B) C) D) contains a cycle, and it is deadlocked contains a cycle but it is not deadlocked contains no cycles and is not deadlocked contains no cycles and is deadlocked

25. If a resource-allocation graph has a cycle, the system must be in a deadlocked state. A) True B) False 26. In some circumstances, a system can be in a frozen state but not in a deadlocked state. A) True B) False

27. A semaphore ____. A) can be modified simultaneously by multiple threads B) is accessed through only one standard operation C) is essentially an integer variable D) cannot be used to control access to a thread's critical sections 28. A race condition ____. A) results when several threads try to access the same data concurrently B) results when several threads try to access the same data concurrently C) will result only if the outcome of execution depends on the order in which instructions are executed D) None of the above 29. An operation that executes atomically ____. A) may consist of only one, or several, machine instructions B) executes as a single, uninterruptible unit C) may be used to solve the critical section problem D) All of the above 30. A spinlock ____. A) is never advantageous for thread scheduling management B) will ultimately result in a context switch when a process must wait on a lock C) does not require a context switch when a process must wait on a lock D) is useful when locks are expected to be held for long amounts of time 31. A claim edge of a resource allocation graph __________ . A) is identical to a request edge B) resembles an allocation edge in direction but is represented in the graph by a dashed line C) indicates that a process may request a resource at some time in the future D) requires that the claiming process be given high priority in scheduling 32. The Producer-Consumer problem is related to _________ . A) B) C) D) the handling of process state queues the scheduling of process states the allocation of resources to process states Both A and C are correct answers.

33. In Peterson's solution, the ____ variable indicates if a process is ready to enter its critical section. A) turn B) lock C) flag[i] D) turn[i]

34. A(n) ___ type presents a set of programmer-defined operations that are provided mutual exclusion within the set. A) transaction B) signal C) binary D) monitor 35. A transaction ____. A) performs multiple logical functions B) is a single instruction C) is a single operation D) performs a single logical function 36. Protocols to prevent hold-and-wait conditions typically also prevent starvation. A) True B) False 37. A deadlock-free solution eliminates the possibility of starvation. A) True B) False 38. A thread does not share with its peer threads its ______ A) code section B) data section C) semaphore D) operating-system resources 39. Synchronization of message passing between processes is assured by using ______ A) buffering B) queuing C) blocking D) mutexing

40. Response time refers to the amount of time ______ . A) that CPU utilization is minimized B) to execute a particular process C) a process has been waiting in the ready queue D) it takes from when a request was submitted until the first action is produced 41. Which of the following data structures in the Banker's algorithm is a vector of length m, where m is the number of resource types? A) Need B) Allocation C) Max D) Available 42. Which of the following is most often used by operating systems to handle deadlocks? A) Assume that deadlocks never occur B) Use protocols to prevent or avoid deadlocks C) Detect and recover from deadlocks D) None of the above 43. The safety algorithm provided in the text may require what order of operations to determine whether a state is safe? Assume n is the number of processes and m is the number of resources. A) m n B) m 2 n C) m n 2 D) (m n) 2 44. A cycle in a resource-allocation graph is ____. A) a necessary and sufficient condition for deadlock in the case that each resource has more than one instance B) a necessary and sufficient condition for a deadlock in the case that each resource has exactly one instance C) a sufficient condition for a deadlock in the case that each resource has more than once instance D) is neither necessary nor sufficient for indicating deadlock in the case that each resource has exactly one instance 45. In a system resource-allocation graph, ____. A) a directed edge from a process to a resource is called an assignment edge B) a directed edge from a resource to a process is called an assignment edge C) a directed edge from a process to a resource is called a claim edge D) None of the above

46. A deadlocked state occurs whenever ____. A) a process is waiting for I/O to a device that does not exist B) the system has no available free resources C) every process in a set is waiting for an event that can only be caused by another process in the set D) a process is unable to release its request for a resource after use 47. One necessary condition for deadlock is ____, which states that at least one resource must be held in a non-sharable mode. A) hold and wait B) mutual exclusion C) circular wait D) no preemption 48. The local variables of a monitor can be accessed by ___________ . A) B) C) D) licensed developers signals only the operating system kernel threads only the local procedures

49. The Banker's Algorithm is used _______ A) to determine if a process state is safe and is not used to perform resource allocations B) to determine if resources can be allocated safely and is not used to perform detection of deadlocks C) to determine if processes can be scheduled and used to perform detection of safe states D) to determine if deadlock will occur and to re-schedule processes 50. Suppose that there are 12 resources available to three processes. At time 0, the following data is collected. The table indicates the process, the maximum number of resources needed by the process, and the number of resources currently owned by each process. Which of the following correctly characterizes this state? Process Maximum Needs Currently Owned P0 12 6 P1 5 2 P2 10 5 A) It is safe. B) It is not safe. C) The state cannot be determined. D) It is an impossible state.

51. Suppose that there are 12 resources available to three processes. At time 0, the following data is collected. The table indicates the process, the maximum number of resources needed by the process, and the number of resources currently owned by each process. Which of the following correctly characterizes this state? Process Maximum Needs Currently Owned P0 12 4 P1 3 1 P2 6 5 A) It is safe. B) It is not safe. C) The state cannot be determined. D) It is an impossible state.

52. Suppose that there are 15 resources available to three processes. At time 0, the following data is collected. The table indicates the process, the maximum number of resources needed by the process, and the number of resources currently owned by each process. Which of the following correctly characterizes this state? Process Maximum Needs Currently Owned P0 6 3 P1 3 1 P2 15 10 A) It is safe. B) It is not safe. C) The state cannot be determined. D) It is an impossible state. 53. A cycle in resource allocation graph _____ leads to a deadlock. A) Always B) May not C) Must D) None of the above

54. Which of the following methods of binding instructions and data to memory is performed by most general-purpose operating systems? A) interrupt binding B) compile time binding C) execution time binding D) load time binding

55. An address generated by a CPU is referred to as a ____. A) physical address B) logical address C) post relocation register address D) Memory-Management Unit (MMU) generated address

56. Suppose we are operating with execution-time binding and the physical address generated is 305. The relocation register is set to 99. What is the corresponding logical address? A) 404 B) 206 C) 200 D) 305

57. In a dynamically linked library, ____. A) loading is postponed until execution time B) system language libraries are treated like any other object module C) more disk space is used than the option of using a statically-linked library D) a stub is included in the image for each library-routine reference

58. Which of the following dynamic storage-allocation algorithms results in the largest leftover hole in memory? A) first fit B) best fit C) worst fit D) None of the above

59. Which of the following is true of compaction? A) It can be done at assembly, load, or execution time. B) It is used to solve the problem of internal fragmentation. C) It cannot shuffle memory contents. D) It is possible only if relocation is dynamic and done at execution time.

60. The purpose of a Memory Management Unit is to ___________ . A) perform run-time mapping from virtual to physical addresses B) ensure protection of the memory space allocated to every process C) Both A and B are correct responses. D) None of these responses is correct.

You might also like