Final exam

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Maximum Needs Currently Owned P0 10 4 P1 3 1 P2

. Deadlock prevention using preempting allocated resources cannot be used for A) mutexes. B) CPU registers. C) database transactions. D) memory. 96. Which of the following statement is true? A) An unsafe state is a deadlocked state. B) A deadlocked state is a safe state. C) An unsafe state will lead to a deadlocked state. D) An unsafe state may lead to a deadlocked state. 97. Suppose that there are ten 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. Process

Chapter - 4 Threads & Concurrency 34. ____ is a thread library for Solaris that maps many user-level threads to one kernel thread. A) Pthreads B) Green threads C) Sthreads D) Java threads 3

30. A(n) ______________ allows several unrelated processes to use the pipe for communication. A) named pipe B) anonymous pipe C) LIFO D) ordinary pipe 31. Which of the following statements is true? A) Shared memory is typically faster than message passing. B) Message passing is typically faster than shared memory. C) Message passing is most useful for exchanging large amounts of data. D) Shared memory is far more common in operating systems than message passing. 32. The Windows CreateFile() system call is used to create a file. What is the equivalent system call in UNIX: A) ioctl() B) open() C) fork() D) createfile() 33. Android runs Java programs _____________ A) in the Dalvik virtual machine. B) natively. C) in the Java virtual machine. D) Android does not run Java programs.

Deadlock Multiple Choice Questions 84. In the deadlock example shown in Figure 8.1, A) a deadlock is guaranteed to occur. B) a deadlock may occur sometime, but not necessarily every time. C) a deadlock may occur sometime only if there are more than one instances of thread_one and thread_two are running. D) a deadlock is guaranteed to occur as long as there are more than one instances of thread_one and thread_two are running. 8

A process control block ____. A) includes information on the process's state B) stores the address of the next instruction to be processed by a different process C) determines which process is to be executed next D) is an example of a process queue 76. The list of processes waiting for a particular I/O device is called a(n) ____. A) standby queue B) device queue C) ready queue D) interrupt queue 77. The _____________ refers to the number of processes in memory. A) process count B) long-term scheduler C) degree of multiprogramming D) CPU scheduler 78. When a child process is created, which of the following is a possibility in terms of the execution or address space of the child process? A) The child process runs concurrently with the parent. B) The child process has a new program loaded into it. C) The child is a duplicate of the parent. D) All of the above 79. A _________________ saves the state of the currently running process and restores the state of the next process to run. A) save-and-restore B) state switch C) context switch D) none of the above 80. A process may transition to the Ready state by which of the following actions? A) Completion of an I/O event B) Awaiting its turn on the CPU C) Newly-admitted process D) All of the above 81. In a(n) ____ temporary queue, the sender must always block until the recipient receives the message. A) zero capacity B) variable capacity C) bounded capacity D) unbounded capacity 82. A blocking send() and blocking receive() is known as a(n) _________________ A) synchronized message B) rendezvous C) blocked message D) asynchronous message 83 . Which of the following is true in a Mach operating system? A) All messages have the same priority. B) Multiple messages from the same sender are guaranteed an absolute ordering. C) The sending thread must return immediately if a mailbox is full. D) It is not designed for distributed systems. Chapter 8

1. In what way is an operating system like a government? A) It seldom functions correctly. B) It creates an environment within which other programs can do useful work. C) It performs most useful functions by itself. D) It is always concerned primarily with the individual's needs. 2. ____ operating systems are designed primarily to maximize resource utilization. A) PC B) Handheld computer C) Mainframe D) Network 3. The most common secondary storage device is ____. A) random access memory B) solid state disks C) tape drives D) magnetic disk 4. Which of the following would lead you to believe that a given system is an SMP-type system? A) Each processor is assigned a specific task. B) There is a boss-worker relationship between the processors. C) Each processor performs all tasks within the operating system. D) None of the above 5. A ____ can be used to prevent a user program from never returning control to the operating system. A) portal B) program counter C) firewall D) timer 6. Embedded computers typically run on a ____ operating system. A) real-time B) Windows XP C) network D) clustered 7. Bluetooth and 802.11 devices use wireless technology to communicate over several feet, in essence creating a ____. A) local-area network B) wide-area network C) small-area network D) metropolitan-area network 8. A clustered system ____. A) gathers together multiple CPUs to accomplish computational work B) is an operating system that provides file sharing across a network C) is used when rigid time requirements are present D) can only operate one application at a time 9. Which of the following is a property of peer-to-peer systems? A) Clients and servers are not distinguished from one another. B) Separate machines act as either the client of the server but not both. C) They do not offer any advantages over traditional client-server systems. D) They suffer from the server acting as the bottleneck in performance. 10. Two important design issues for cache memory are ____. A) speed and volatility B) size and replacement policy C) power consumption and reusability D) size and access privileges 11. What are some other terms for kernel mode? A) supervisor mode B) system mode C) privileged mode D) All of the above 12. Which of the following statements concerning open source operating systems is true? A) Solaris is open source. B) Source code is freely available. C) They are always more secure than commercial, closed systems. D) All open source operating systems share the same set of goals. 13. Which of the following operating systems is not open source? A) Windows B) BSD UNIX C) Linux D) PCLinuxOS 14. A _____ provides a file-system interface which allows clients to create and modify files. A) compute-server system B) file-server system C) wireless network D) network computer 15. A ____ is a custom build of the Linux operating system A) LiveCD B) installation C) distribution D) VMWare Player 16. __________ is a set of software frameworks that provide additional services to application developers. A) System programs B) Virtualization C) Cloud computing D) Middleware 17. What statement concerning privileged instructions is considered false? A) They may cause harm to the system. B) They can only be executed in kernel mode. C) They cannot be attempted from user mode. D) They are used to manage interrupts. 18. Which of the following statements is false? A) Mobile devices must be concerned with power consumption. B) Mobile devices can provide features that are unavailable on desktop or laptop computers. C) The difference in storage capacity between a mobile device and laptop is shrinking. D) Mobile devices usually have fewer processing cores than a standard desktop computer. 19. A(n) ________ is the unit of work in a system. A) process B) operating system C) timer D) mode bit 20. The two separate modes of operating in a system are A) supervisor mode and system mode B) kernel mode and privileged mode C) physical mode and logical mode D) user mode and kernel mode Chapter - 2 Operating-System Structures 21. _____ allow operating system services to be loaded dynamically. A) Virtual machines B) Modules C) File systems D) Graphical user interfaces 22. Microkernels use _____ for communication. A) message passing B) shared memory C) system calls D) virtualization 23. The Windows CreateProcess() system call creates a new process. What is the equivalent system call in UNIX: A) NTCreateProcess() B) process() C) fork() D) getpid() 24. The close() system call in UNIX is used to close a file. What is the equivalent system call in Windows: A) CloseHandle() B) close() C) CloseFile() D) Exit() Chapter- 3 Processes 25. A process may transition to the Ready state by which of the following actions? A) Completion of an I/O event B) Awaiting its turn on the CPU C) Newly-admitted process D) All of the above 26. In a(n) ____ temporary queue, the sender must always block until the recipient receives the message. A) zero capacity B) variable capacity C) bounded capacity D) unbounded capacity 27. A blocking send() and blocking receive() is known as a(n) _________________ A) synchronized message B) rendezvous C) blocked message D) asynchronous message 28 . Which of the following is true in a Mach operating system? A) All messages have the same priority. B) Multiple messages from the same sender are guaranteed an absolute ordering. C) The sending thread must return immediately if a mailbox is full. D) It is not designed for distributed systems. 29. When communicating with sockets, a client process initiates a request for a connection and is assigned a port by the host computer. Which of the following would be a valid port assignment for the host computer? A) 21 B) 23 C) 80 D) 1625 30. A(n) ______________ allows several unrelated processes to use the pipe for communication. A) named pipe B) anonymous pipe C) LIFO D) ordinary pipe 31. Which of the following statements is true? A) Shared memory is typically faster than message passing. B) Message passing is typically faster than shared memory. C) Message passing is most useful for exchanging large amounts of data. D) Shared memory is far more common in operating systems than message passing. 32. The Windows CreateFile() system call is used to create a file. What is the equivalent system call in UNIX: A) ioctl() B) open() C) fork() D) createfile() 33. Android runs Java programs _____________ A) in the Dalvik virtual machine. B) natively. C) in the Java virtual machine. D) Android does not run Java programs.

Chapter - 4 Threads & Concurrency 34. ____ is a thread library for Solaris that maps many user-level threads to one kernel thread. A) Pthreads B) Green threads C) Sthreads D) Java threads 35. Pthreads refers to ____. A) the POSIX standard. B) an implementation for thread behavior. C) a specification for thread behavior. D) an API for process creation and synchronization. 36. The ____ multithreading model multiplexes many user-level threads to a smaller or equal number of kernel threads. A) many-to-one model B) one-to-one model C) many-to-many model D) many-to-some model 37. Cancellation points are associated with ____ cancellation. A) asynchronous B) deferred C) synchronous D) non-deferred 38. Which of the following would be an acceptable signal handling scheme for a multithreaded program? A) Deliver the signal to the thread to which the signal applies. B) Deliver the signal to every thread in the process. C) Deliver the signal to only certain threads in the process. D) All of the above 39. Signals can be emulated in windows through ____. A) asynchronous procedure calls B) local procedure calls C) remote procedure calls D) none of the above 40. Thread-local storage is data that ____. A) is not associated with any process B) has been modified by the thread, but not yet updated to the parent process C) is generated by the thread independent of the thread's process D) is unique to each thread 41. LWP is ____. A) short for lightweight processor B) placed between system and kernel threads C) placed between user and kernel threads D) common in systems implementing one-to-one multithreading models 42. Windows uses the ____. A) one-to-one model B) many-to-one model C) one-to many-model D) many-to-many model 43. In multithreaded programs, the kernel informs an application about certain events using a procedure known as a(n) ____. A) signal B) upcall C) event handler D) pool Chapter - 5 CPU Scheduling 44. Assume an adaptive mutex is used for accessing shared data on a Solaris system with multiprocessing capabilities. Which of the following statements is not true? A) A waiting thread may spin while waiting for the lock to become available. B) A waiting thread may sleep while waiting for the lock to become available. C) The adaptive mutex is only used to protect short segments of code. D) Condition variables and semaphores are never used in place of an adaptive mutex. 45. What is the purpose of the mutex semaphore in the implementation of the bounded-buffer problem using semaphores? A) It indicates the number of empty slots in the buffer. B) It indicates the number of occupied slots in the buffer. C) It controls access to the shared buffer. D) It ensures mutual exclusion. 46. How many philosophers may eat simultaneously in the Dining Philosophers problem with 5 philosophers? A) 1 B) 2 C) 3 D) 5 47. 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 48. _____ is/are not a technique for managing critical sections in operating systems. A) Peterson's solution B) Preemptive kernel C) Nonpreemptive kernel D) Semaphores 49. When using semaphores, a process invokes the wait() operation before accessing its critical section, followed by the signal() operation upon completion of its critical section. Consider reversing the order of these two operations—first calling signal(), then calling wait(). What would be a possible outcome of this? A) Starvation is possible. B) Several processes could be active in their critical sections at the same time. C) Mutual exclusion is still assured. D) Deadlock is possible. 50. Which of the following statements is true? A) Operations on atomic integers do not require locking. B) Operations on atomic integers do require additional locking. C) Linux only provides the atomic_inc() and atomic_sub() operations. D) Operations on atomic integers can be interrupted. 51. A(n) ___________ is a sequence of read-write operations that are atomic. A) atomic integer B) semaphore C) memory transaction D) mutex lock 52. The OpenMP #pragma omp critical directive ___________. A) behaves much like a mutex lock B) does not require programmers to identify critical sections C) does not guarantee prevention of race conditions D) is similar to functional languages 53. Another problem related to deadlocks is ____________. A) race conditions B) critical sections C) spinlocks D) indefinite blocking Chapter - 6 Synchronization 54. Which of the following is true of cooperative scheduling? A) It requires a timer. B) A process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state. C) It incurs a cost associated with access to shared data. D) A process switches from the running state to the ready state when an interrupt occurs. 55. ____ is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput 56. ____ scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU bursts. A) Multilevel queue B) RR C) FCFS D) SJF 57. The ____ scheduling algorithm is designed especially for time-sharing systems. A) SJF B) FCFS C) RR D) Multilevel queue 58. Which of the following scheduling algorithms must be nonpreemptive? A) SJF B) RR C) FCFS D) priority algorithms 59. Which of the following is true of multilevel queue scheduling? A) Processes can move between queues. B) Each queue has its own scheduling algorithm. C) A queue cannot have absolute priority over lower-priority queues. D) It is the most general CPU-scheduling algorithm. 60. The default scheduling class for a process in Solaris is ____. A) time sharing B) system C) interactive D) real-time 61. Which of the following statements are false with regards to the Linux CFS scheduler? A) Each task is assigned a proportion of CPU processing time. B) Lower numeric values indicate higher relative priorities. C) There is a single, system-wide value of runtime. D) The scheduler doesn't directly assign priorities. 62. The Linux CFS scheduler identifies _____________ as the interval of time during which every runnable task should run at least once. A) virtual run time B) targeted latency C) nice value D) load balancing 63. In Little's formula, λ, represents the ____. A) average waiting time in the queue B) average arrival rate for new processes in the queue C) average queue length D) average CPU utilization 64. In Solaris, what is the time quantum (in milliseconds) of an interactive thread with priority 35? A) 25 B) 54 C) 80 D) 35 65. In Solaris, if an interactive thread with priority 15 uses its entire time quantum, what is its priority recalculated to? A) 51 B) 5 C) 160 D) It remains at 15 66. In Solaris, if an interactive thread with priority 25 is waiting for I/O, what is its priority recalculated to when it is eligible to run again? A) 15 B) 120 C) 52 D) It remains at 25 67. ______ allows a thread to run on only one processor. A) Processor affinity B) Processor set C) NUMA D) Load balancing 68. What is the numeric priority of a Windows thread in the NORMAL_PRIORITY_CLASS with HIGHEST relative priority? A) 24 B) 10 C) 8 D) 13 Ans: B 69. What is the numeric priority of a Windows thread in the HIGH_PRIORITY_CLASS with ABOVE_NORMAL relative priority? A) 24 B) 10 C) 8 D) 14 70. What is the numeric priority of a Windows thread in the BELOW_NORMAL_PRIORITY_CLASS with NORMAL relative priority? A) 6 B) 7 C) 5 D) 8 71. __________ involves the decision of which kernel thread to schedule onto which CPU. A) Process-contention scope B) System-contention scope C) Dispatcher D) Round-robin scheduling 72. With _______ a thread executes on a processor until a long-latency event (i.e. a memory stall) occurs. A) coarse-grained multithreading B) fine-grained multithreading C) virtualization D) multicore processors 72. A significant problem with priority scheduling algorithms is _____. A) complexity B) starvation C) determining the length of the next CPU burst D) determining the length of the time quantum 73. The ______ occurs in first-come-first-served scheduling when a process with a long CPU burst occupies the CPU. A) dispatch latency B) waiting time C) convoy effect D) system-contention scope Chapter- 3 74. The ____ of a process contains temporary data such as function parameters, return addresses, and local variables. A) text section B) data section C) program counter D) stack 75 A process control block ____. A) includes information on the process's state B) stores the address of the next instruction to be processed by a different process C) determines which process is to be executed next D) is an example of a process queue 76. The list of processes waiting for a particular I/O device is called a(n) ____. A) standby queue B) device queue C) ready queue D) interrupt queue 77. The _____________ refers to the number of processes in memory. A) process count B) long-term scheduler C) degree of multiprogramming D) CPU scheduler 78. When a child process is created, which of the following is a possibility in terms of the execution or address space of the child process? A) The child process runs concurrently with the parent. B) The child process has a new program loaded into it. C) The child is a duplicate of the parent. D) All of the above 79. A _________________ saves the state of the currently running process and restores the state of the next process to run. A) save-and-restore B) state switch C) context switch D) none of the above 80. A process may transition to the Ready state by which of the following actions? A) Completion of an I/O event B) Awaiting its turn on the CPU C) Newly-admitted process D) All of the above 81. In a(n) ____ temporary queue, the sender must always block until the recipient receives the message. A) zero capacity B) variable capacity C) bounded capacity D) unbounded capacity 82. A blocking send() and blocking receive() is known as a(n) _________________ A) synchronized message B) rendezvous C) blocked message D) asynchronous message 83 . Which of the following is true in a Mach operating system? A) All messages have the same priority. B) Multiple messages from the same sender are guaranteed an absolute ordering. C) The sending thread must return immediately if a mailbox is full. D) It is not designed for distributed systems. Chapter 8 Deadlock Multiple Choice Questions 84. In the deadlock example shown in Figure 8.1, A) a deadlock is guaranteed to occur. B) a deadlock may occur sometime, but not necessarily every time. C) a deadlock may occur sometime only if there are more than one instances of thread_one and thread_two are running. D) a deadlock is guaranteed to occur as long as there are more than one instances of thread_one and thread_two are running. 85. In the livelock example shown in Figure 8.2, A) a livelock is guaranteed to occur. B) a livelock may occur sometime. C) a livelock may occur sometime only if there are more than one instances of thread_one and thread_two are running. D) a livelock is guaranteed to occur as long as there are more than one instances of thread_one and thread_two are running. 86. One necessary condition for deadlock is ____, which states that at least one resource must be held in a nonsharable mode. A) hold and wait B) mutual exclusion C) circular wait D) no preemption 87. One necessary condition for deadlock is ______, which states that a resource can be released only voluntarily by the process holding the resource. A) hold and wait B) mutual exclusion C) circular wait D) no preemption 88 One necessary condition for deadlock is ______, which states that there is a chain of waiting processes whereby P0 is waiting for a resource held by P1, P1 is waiting for a resource held by P2, and Pn is waiting for a resource held by P0. A) hold and wait B) mutual exclusion C) circular wait D) no preemption 89. 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 90. In a system resource-allocation graph, ____. A) a directed edge from a resource to a process 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 an assignment edge D) None of the above 91. In a resource allocation graph, when a process releases a resource, A) a request edge is inserted. B) an assignment edge is inserted. C) a request edge is removed. D) an assignment edge is removed. 92. A system will never enter a deadlocked state if A) the system chooses to ignore the problem altogether. B) the system uses the detection and recovery technique. C) the system uses the deadlock avoidance technique. D) None of the above. 93. Deadlocks can be prevented only if A) all four necessary conditions cannot hold. B) at least one of the four necessary conditions cannot hold. C) mutual exclusion condition cannot hold. D) circular wait condition cannot hold. 94. A _____ could be preempted from a process. A) mutex lock B) CPU registers C) semaphore D) file lock 95. Deadlock prevention using preempting allocated resources cannot be used for A) mutexes. B) CPU registers. C) database transactions. D) memory. 96. Which of the following statement is true? A) An unsafe state is a deadlocked state. B) A deadlocked state is a safe state. C) An unsafe state will lead to a deadlocked state. D) An unsafe state may lead to a deadlocked state. 97. Suppose that there are ten 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. Process Maximum Needs Currently Owned P0 10 4 P1 3 1 P2 5 4 At time 1, P1 requests a resource. Which of the following is correct? A) The request will be granted, since the current state is safe. B) The request will not be granted, since the current state is not safe. C) The request will be granted, since the state after granting the request will be safe. D) The request will not be granted, since the state after granting the request will be unsafe. 98. A claim edge in a resource-allocation graph indicates that A) a process has been allocated a resource. B) a process may request a resource. C) a process may release a resource that it has already been assigned. D) a process has requested a resource. 99. 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 100. Suppose that there are two resource types (R1 and R2) with five resources each available to four processes. At time 0, the following data is collected. The table indicates the process, the number of resources of each type currently allocated to the processes, and the current request of each resource type by each process. Process Allocation Request R1 R2 R1 R2 P0 2 0 3 2 P1 1 1 1 0 P2 0 1 1 1 P3 1 1 3 2 Which of the following sentences is correct? A) All four processes are currently deadlocked. B) The system is not deadlocked. C) Processes P0 and P3 are deadlocked. D) Processes P0, P1 and P3 are deadlocked. 101. In a system that uses deadlock detection algorithm, A) a deadlock is detected as soon as it occurs. B) a deadlock is detected just before it occurs. C) a deadlock is detected sometime after it has occurred but not necessarily immediately. D) a deadlock is detected sometime before it occurs, but not necessarily just before. 102. Which of the following is not a factor in choosing which process to terminate during recovery from a deadlock? A) Who the parent of the process is. B) How many more resources the process needs in order to complete. C) How many processes will need to be terminated. D) What the priority of the process is Essay Questions 103 . Explain what has to happen for a set of processes to achieve a deadlocked state. 104. Describe the four conditions that must hold simultaneously in a system if a deadlock is to occur. 105 What are the three general ways that a deadlock can be handled? 106. What is the difference between deadlock prevention and deadlock avoidance? 107. What is one way to ensure that a circular-wait condition does not occur? 108. Distinguish between coarse-grained and fine-grained multithreading. 109. Explain the concept of a CPU-I/O burst cycle. 110 What role does the dispatcher play in CPU scheduling? 110. Explain the difference between response time and turnaround time. These times are both used to measure the effectiveness of scheduling schemes. 111. What effect does the size of the time quantum have on the performance of an RR algorithm? 112. Explain the process of starvation and how aging can be used to prevent it. Difficulty: Difficult 113. Explain the fundamental difference between asymmetric and symmetric multiprocessing. 114 . What are Solution to Critical-Section Problem give detail 115 Explain two general approaches to handle critical sections in operating systems. 116. Describe the operating system's two modes of operation. 117 List the four major categories of the benefits of multithreaded programming. Briefly explain each. True/False 118. Race conditions are prevented by requiring that critical regions be protected by locks. 119. The value of a counting semaphore can range only between 0 and 1. 120. A deadlock-free solution eliminates the possibility of starvation. 121. The local variables of a monitor can be accessed by only the local procedures. 122. Every object in Java has associated with it a single lock. 123. Monitors are a theoretical concept and are not practiced in modern programming languages 124. A traditional (or heavyweight) process has a single thread of control. 125. A thread is composed of a thread ID, program counter, register set, and heap. 126. Virtually all contemporary operating systems support kernel threads. 127. Linux distinguishes between processes and threads. 128. In Java, data shared between threads is simply declared globally. 129. Each thread has its own register set and stack. 130. Solid state disks are considered volatile storage. 131. There is no universally accepted definition of an operating system. 132 Systems using a one-to-one model (such as Windows, Solaris , and Linux) schedule threads using process-contention scope (PCS).


संबंधित स्टडी सेट्स

Medical Terminology Ch1 Test Questions

View Set

General Insurance Regulation Chapter Quiz

View Set

Describe the components and digestive functions of saliva.

View Set

Financial Management - Chapter 7

View Set