Quiz
Operating Systems Quiz 2
This quiz has question types that open in the usual player.
Questions in this quiz (143)
1What is the purpose of the mutex semaphore in the implementation of the bounded-buffer problem using semaphores?
- AIt indicates the number of empty slots in the buffer
- BIt indicates the number of occupied slots in the buffer
- CIt controls access to the shared buffer
- DIt ensures mutual exclusion
2The first readers-writers problem _______.
- Arequires that, once a writer is ready, that writer performs its write as soon as possible.
- Bis not used to test synchronization primitives.
- Crequires that no reader will be kept waiting unless a writer has already obtained permission to use the shared database.
- Drequires that no reader will be kept waiting unless a reader has already obtained permission to use the shared database.
3How many philosophers may eat simultaneously in the Dining Philosophers problem with 5 philosophers?
- A1
- B2
- C3
- D5
4Operations on atomic integers do not require locking.
- ATrue
- BFalse
5Operations on atomic integers do require additional locking.
- ATrue
- BFalse
6Linux only provides the atomic_inc() and atomic_sub() operations.
- ATrue
- BFalse
7Operations on atomic integers can be interrupted.
- ATrue
- BFalse
8A thread will immediately acquire a dispatcher lock that is in the signaled state.
- ATrue
- BFalse
9Linux mostly uses atomic integers to manage race conditions within the kernel.
- ATrue
- BFalse
10Pthreads can be implemented
- Aonly in side the operating system kernel.
- Bonly at the user level.
- Cat the user level or inside the operating system kernel.
- Donly in Windows OS.
11When the owner of a mutex lock invokes pthread mutex unlock(), all threads blocked on that mutex's lock are unblocked.
- ATrue
- BFalse
12A call to pthread_cond_signal()
- Areleases the mutex lock and signals one thread waiting on the condition variable.
- Breleases the mutex lock and signals all threads waiting on the condition variable.
- Csignals one thread waiting on the condition variable, but does not release the mutex lock.
- Dsignal all threads waiting on the condition variable, but does not release the mutex lock.
13In Java, when a thread calls notify(), an arbitrary thread T from the list of threads in the wait set
- Ais set to runnable state and T immediately regains control of the lock.
- Bis set to runnable state and is moved from the wait set to entry set where it regains the control of the lock as soon as the thread calling notify() exits its method.
- Cis set to runnable state and is moved from the wait set to entry set where it regains the control of the lock only after all other threads in the entry set have acquired and released the lock.
- Dis set to runnable state and is moved from the wait set to entry set where it competes for the lock with the other threads in the entry set.
14A reentrant lock allows for granting the lock to the longest waiting thread when unlock() is called.
- ATrue
- BFalse
15When a thread invokes the signal() method of a condition variable, all threads blocked on that condition variable are unblocked.
- ATrue
- BFalse
16The OpenMP #pragma omp critical directive
- Abehaves much like a mutex lock.
- Bdoes not require programmers to identify critical sections.
- Cdoes not guarantee prevention of race conditions.
- Dis similar to functional languages.
17An advantage of transactional memory system is that the developer doesn't have to worry about implementing atomicity.
- ATrue
- BFalse
18In a functional programming language
- Avariables may be assigned different values over time.
- Bvalue of a variable can be changed only by the thread that created it.
- Cvalue of a variable is immutable.
- Ddevelopers have to implement atomicity.
19A race condition
- Aresults when several threads to try access the same data concurrently.
- Bresults when several threads try to access and modify the same data concurrently.
- Cwill result only if the outcome of execution does not depend on the order in which instructions are executed.
- DNone of the above.
20Instructions from different processes can be interleaved when interrupts are allowed.
- ATrue
- BFalse
21A(n) _______ refers to where a process is accessing/updating shared data.
- Acritical section
- Bentry section
- Cmutex
- Dtest-and-set
22A solution to the critical section problem does not have to satisfy which of the following requirements?
- Amutual exclusion
- Bprogress
- Catomicity
- Dbounded waiting
23A nonpreemptive kernel is safe from race conditions on kernel data structures.
- ATrue
- BFalse
24In Peterson's solution, the _____ variable indicates if a process is ready to enter its critical section.
- Aturn
- Block
- Cflag[i]
- Dturn[i]
25________ is not a technique for handling critical sections in operating systems.
- ANonpreemptive kernels
- BPreemptive kernels
- CSpinlocks
- DPeterson's solution
26An instruction that executes atomically _________
- Amust consist of only one machine instruction
- Bexecutes as a single, uninterruptible unit
- Ccannot be used to solve the critical section problem
- DAll of the above
27Race conditions are prevented by requiring that critical regions be protected by locks.
- ATrue
- BFalse
28Both the test_and_set() instruction and compare_and_swap() instruction are executed atomically.
- ATrue
- BFalse
29A mutex lock _______
- Ais exactly like a counting semaphore.
- Bis essentially a boolean variable.
- Cis not guaranteed to be atomic.
- Dcan be used to eliminate busy waiting.
30What is the correct order of operations for protecting a critical section using mutex locks?
- Arelease() followed by acquire()
- Bacquire() followed by release()
- Cwait() followed by signal()
- Dsignal() followed by wait()
31Busy waiting refers to the phenomenon that while a process is in its critical section, any other process that tries to enter its critical section must loop continuously in the call to acquire the mutex lock.
- ATrue
- BFalse
32A counting semaphore __________
- Ais essentially an integer variable.
- Bis accessed through only one standard operation.
- Ccan be modified simultaneously by multiple threads.
- Dcannot be used to control access to a thread's critical section.
33________ can be used to prevent busy waiting when implementing a semaphore.
- ASpinlocks
- BWaiting queues
- CMutex lock
- DAllowing the wait() operation to succeed
34Mutex locks and binary semaphores are essentially the same thing.
- ATrue
- BFalse
35A ______ type presents a set of programmer-defined operations that are provided mutual exclusion within it.
- Atransaction
- Bsignal
- Cbinary
- Dmonitor
36The local variables of a monitor can be accessed by only the local procedures.
- ATrue
- BFalse
37Monitors are a theoretical concept and are not practiced in modern programming languages.
- ATrue
- BFalse
38A deadlock-free solution eliminates the possibility of starvation.
- ATrue
- BFalse
39Another problem related to deadlocks is _________
- Arace conditions
- Bcritical sections
- Cspinlocks
- Dindefinite blocking
40_________ occurs when a higher-priority process needs to access a data structure that is currently being accessed by a lower-priority process.
- APriority inversion
- BDeadlock
- CA race condition
- DA critical section
41Traditional synchronization is always much faster than CAS-based synchronization.
- ATrue
- BFalse
42Which of the following is true of cooperative scheduling?
- AIt requires a timer
- BA process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state.
- CIt incurs a cost associated with access to shared data.
- DA process switches from the running state to the ready state when an interrupt occurs.
43In preemptive scheduling, the section of code affected by interrupts must be guarded from simultaneous use.
- ATrue
- BFalse
44_________ is the number of processes that are completed per time unit.
- ACPU utilization
- BResponse time
- CTurnaround time
- DThroughput
45_______ scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU bursts.
- AMultilevel queue
- BRR
- CFCFS
- DSJF
46The ______ scheduling algorithm is designed especially for time-sharing systems.
- ASJF
- BFCFS
- CRR
- DMulti-level queue
47Which of the following is true of multilevel queue scheduling?
- AProcesses can move between queues
- BEach queue has its own scheduling algorithm
- CA queue cannot have absolute priority over lower-level priority queues
- DIt is the most general CPU-scheduling algorithm
48_________ involves the decision of which kernel thread to schedule onto which CPU.
- AProcess-contention scope
- BSystem-contention scope
- CDispatcher
- DRound-robin scheduling
49_________ allows a thread to run on only one processor.
- AProcessor affinity
- BProcessor set
- CNUMA
- DLoad balancing
50With ______ a thread executes on a processor until a long-latency event (i.e. a memory stall) occurs.
- Acoarse-grained multithreading
- Bfine-grained multithreading
- Cvirtualization
- Dmulticore processors
51The two general approaches to load balancing are ______ and ________.
- Asoft affinity, hard affinity
- Bcoarse grained, fine grained
- Csoft real-time, hard real-time
- Dpush migration, pull migration
52The rate of a periodic task in a hard real-time system is _______, where p is a period and t is the processing time.
- A1/p
- Bp/t
- C1/t
- Dpt
53Which of the following is true of the rate-monotonic scheduling algorithm?
- AThe task with the shortest period will have the lowest priority.
- BIt uses a dynamic priority policy.
- CCPU utilization is bounded when using this algorithm.
- DIt is non-preemptive.
54Which of the following is true of the earliest-deadline-first (EDF) scheduling algorithm?
- AWhen a process becomes runnable, it must announce its deadline requirements to the system.
- BDeadlines are assigned as following: the earlier the deadline, the lower the priority; the later the deadline, the higher the priority.
- CPriorities are fixed; that is, they cannot be adjusted when a new process starts running.
- DIt assigns priorities statically according to deadline.
55Which of the following statements are false with regards to the Linux CFS scheduler?
- AEach task is assigned a proportion of CPU processing time.
- BLower numeric values indicate higher relative priorities.
- CThere is a single, system-wide value of vruntime.
- DThe scheduler doesn't directly assign priorities.
56What is the numeric priority of a Windows thread in the HIGH_PRIORITY_CLASS with ABOVE_NORMAL relative priority?
- A24
- B10
- C8
- D14
57In Solaris, if an interactive thread with priority 15 uses its entire time quantum, what is its priority recalculated to?
- A51
- B5
- C160
- DIt remains at 15
58A deadlocked state occurs whenever _________
- Aa process is waiting for I/O to a device that does not exist
- Bthe system has no available free resources
- Cevery process in a set is waiting for an event that can only be caused by another process in the set
- Da process is unable to release its request for a resource after use
59Deadlock occurs when every thread in a set is blocked waiting for an event that can be caused only by another thread in the set, while livelock occurs when a thread continuously attempts an action that fails.
- ATrue
- BFalse
60In the dining philosophers problem, there is a possibility of a deadlock but not a livelock.
- ATrue
- BFalse
61One necessary condition for deadlock is ________ , which states that a process must be holding one resource and waiting to acquire additional resources.
- Ahold and wait
- Bmutual exclusion
- Ccircular wait
- Dno preemption
62A cycle in a resource-allocation graph is _________
- Aa necessary and sufficient condition for deadlock in the case that each resource has more than one instance.
- Ba necessary and sufficient condition for a deadlock in the case that each resource has exactly one instance
- Ca sufficient condition for a deadlock in the case that each resource has more than one instance
- Dis neither necessary nor sufficient for indicating deadlock in the case that each resource has exactly one instance
63If a resource-allocation graph has a cycle, the system must be in a deadlocked state.
- ATrue
- BFalse
64To handle deadlocks, operating systems most often _________.
- Apretend that deadlocks never occur
- Buse protocols to prevent or avoid deadlocks
- Cdetect and recover from deadlocks
- DNone of the above
65Both deadlock prevention and deadlock avoidance techniques ensure that the system will never enter a deadlocked state.
- ATrue
- BFalse
66Most operating systems choose to ignore deadlocks, because
- Ahandling deadlocks is expensive in terms of performance and resources.
- Bdeadlocks occur infrequently.
- Cmethods used to recover from livelock may be put to use to recover from deadlock.
- DAll of the above.
67Assume there are three resources, R1, R2, and R3, that are each assigned unique integer values 15, 10, and 25, respectively. What is a resource ordering which prevents a circular wait?
- AR1, R2, R3
- BR3, R2, R1
- CR3, R1, R2
- DR2, R1, R3
68Deadlock prevention by denying the mutual-exclusion condition is the simplest way to prevent deadlocks.
- ATrue
- BFalse
69In deadlock prevention by denying hold-and-wait condition,
- Aresource utilization may be low
- Bstarvation is possible
- Cwhenever a thread requests a resource, it does not hold any other resources.
- DAll of the above.
70Which of the following statements is true?
- AA safe state is a deadlocked state.
- BA safe state may lead to a deadlocked state.
- CAn unsafe state is necessarily, and by definition, always a deadlocked state.
- DAn unsafe state may lead to a deadlocked state.
71The wait-for-graph scheme is not applicable to a resource allocation system with multiple instances of each resource type.
- ATrue
- BFalse
72The decision of when to invoke a detection algorithm depends on the likely frequency of deadlocks and the number of threads likely to be affected by a deadlock when it happens.
- ATrue
- BFalse
73A system can recover from a deadlock by
- Aaborting one process at a time until the deadlock cycle is eliminated.
- Baborting all deadlocked processes.
- Cpreempting some resources from one or more of the deadlocked threads.
- DAll of the above.
74To recover from a deadlock using resource preemption,
- Athe order of resources and processes that need to be preempted must be determined to minimize cost.
- Bif a resource is preempted from a process, the process must be rolled back to some safe state and restarted from that state.
- Censure that starvation does not occur from always preempting resources from the same process.
- DAll of the above.
75Absolute code can be generated for _________.
- Acompile-time binding.
- Bload-time binding.
- Cexecution-time binding.
- Dinterrupt binding.
76In a dynamically linked library, __________
- Aloading is postponed until execution time.
- Bsystem language libraries are treated like any other object module.
- Cmore disk space is used than in a statically linked library.
- Da stub is included in the image for each library-routine reference.
77The mapping of a logical address to a physical address is done in hardware by the _________
- Amemory-management-unit (MMU)
- Bmemory address register
- Crelocation register
- Ddynamic loading register
78__________ is the dynamic storage-allocation algorithm which results in the smallest leftover hole in memory.
- AFirst fit
- BBest fit
- CWorst fit
- DNone of the above
79_________ is the dynamic storage-allocation algorithm which results in the largest leftover hold in memory.
- AFirst fit
- BBest fit
- CWorst fit
- DNone of the above
80Which of the following is true of compaction?
- AIt can be done at assembly, load, or execution time.
- BIt is used to solve the problem of internal fragmentation.
- CIt cannot shuffle memory contents.
- DIt is possible only if relocation is dynamic and done at execution time.
81Consider a logical address with a page size of 8 KB. How many bits must be used to represent the page offset in the logical address?
- A10
- B8
- C13
- D12
82Assume a system has a TLB hit ratio of 90%. It requires 15 nanoseconds to access the TLB, and 85 nanoseconds to access main memory. What is the effective memory access time in nanoseconds for this system?
- A108.5
- B100
- C22
- D176.5
83Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, what is the page offset?
- A0xAE
- B0xF9
- C0xA
- D0xF900
84The two bursts that CPU schedulers are designed around are [blank_start]CPU[blank_end] bursts and [blank_start]I/O[blank_end] bursts.
- ACPU
- BI/O
85Under preemptive scheduling, when a process switches from the running to the ready state, it may lose control of the CPU
- ATrue
- BFalse
86Which of the following are criteria for designing a CPU scheduling algorithm.
- ACPU Utilization
- BResponse Time
- CMemory usage
- DProcess-Contention-Scope (PCS)
- EThroughput
- FLoad sharing
- GWait time
- HAsymmetric Multiprocessing
- ITransition Time
87[blank_start]Priority[blank_end] scheduling algorithm assigns the CPU to the process with the highest priority.
- APriority
88The multilevel feedback queue scheduling algorithm allows processes to migrate between different queues.
- ATrue
- BFalse
89[blank_start]Round-Robin[blank_end] scheduling algorithm assigns the CPU to a process for only its time slice (or time quantum)
- ARound-Robin
90[blank_start]Shortest Job First (SJF)[blank_end] scheduling algorithm assigns the CPU to the process with the shortest burst.
- AShortest Job First (SJF)
91The two types of contention scope for thread scheduling are [blank_start]process-contention scope[blank_end] and [blank_start]system-contention scope[blank_end].
- Aprocess-contention scope
- Bsystem-contention scope
92The two general hardware instructions that can be performed atomically are [blank_start]test-and-set[blank_end] and [blank_start]compare-and-swap[blank_end].
- Atest-and-set
- Bcompare-and-swap
93Symmetric multiprocessing is more common on current operating systems.
- ATrue
- BFalse
94The two types of processor affinity are [blank_start]soft affinity[blank_end] and [blank_start]hard affinity[blank_end].
- Asoft affinity
- Bhard affinity
95The two general approaches for load balancing are [blank_start]push migration[blank_end] and [blank_start]pull migration[blank_end].
- Apush migration
- Bpull migration
96_______ migration is when idle processors pull threads from other processors
- APush
- BPull
97________ is when a core switches between threads at the boundary of an instruction cycle.
- ACoarse gained
- BFine grained
98[blank_start]Soft real-time[blank_end] systems provide no guarantee as to when a critical real-time process will be scheduled.
- ASoft real-time
99In [blank_start]hard[blank_end] real-time systems, a task must be serviced by its deadline; service after the deadline has expired is the same as no service at all.
- Ahard
100The real-time scheduling algorithm that uses deadline as its scheduling criteria is known as [blank_start]Earliest Deadline First[blank_end].
- AEarliest Deadline First
101The real-time scheduling algorithm that is used for scheduling periodic tasks with static priorities is [blank_start]rate-monotonic[blank_end] scheduling.
- Arate-monotonic
102A Windows thread is assigned both a priority class and a relative priority within that class.
- ATrue
- BFalse
103If a thread on a Solaris system exhausts its time quantum, it will later be assigned a _____ priority?
- Ahigher
- Blower
104Deterministic modeling and simulations are similar strategies for evaluating scheduling algorithms.
- ATrue
- BFalse
105The segment of code where shared data is accessed and possibly manipulated is called the [blank_start]critical section[blank_end].
- Acritical section
106Which of the following are requirements that a solution to the critical-section problem must satisfy?
- ACircular Wait
- BMutual Exclusion
- CNo preemption
- DBounded Waiting
- EProgress
107A nonpreemptive kernel is essentially free from race conditions
- ATrue
- BFalse
108There are no guarantees Peterson’s solution works correctly on modern computer architectures
- ATrue
- BFalse
109What are the two functions used with mutex locks? 11 12 Chapter 6 Synchronization Tools?
- Asignal()
- Bacquire()
- Cwait()
- Drelease()
- Esleep()
110A spinlock is a type of mutex lock.
- ATrue
- BFalse
111What are the two operations that can be performed on a semaphore?
- Asignal()
- Bacquire()
- Cwait()
- Drelease()
- Esleep()
112The system model for deadlocks first requires a process request a resource, then use the resource, and finally release the resource.
- ATrue
- BFalse
113Select the necessary conditions for characterizing deadlock.
- ACircular Wait
- BNo preemption
- CProgress
- DHold and wait
- EBounded waiting
- FMutual exclusion
114[blank_start]Circular wait[blank_end] is the only reasonable condition that can be used to prevent deadlocks from occurring.
- ACircular wait
115The names of the two processes associated with the boundedbuffer problem are [blank_start]producer[blank_end] and [blank_start]consumer[blank_end].
- Aproducer
- Bconsumer
116How many writers may concurrently share the database with the readers-writers problem?
- A1
- B2
- CThere is no limit
- D0
117What is the problem if all philosophers simultaneously pick up their left fork?
- ALivelock
- BThe bounded-buffer problem
- CDeadlock
- DNone of the above
118The two states of a Windows dispatcher object are [blank_start]signaled[blank_end] and [blank_start]nonsignaled[blank_end].
- Asignaled
- Bnonsignaled
119_________ is available in Linux for updating an integer variable without having to use locks.
- AAtomic integer
- BMutex lock
- CSemaphore
- DDisabling preemption
120Linux uses spinlocks for both single and multiple processor systems.
- ATrue
- BFalse
121[blank_start]First-Come-First-Served (FCFS)[blank_end] scheduling algorithm assigns the CPU to the process that first requested it.
- AFirst-Come-First-Served (FCFS)
122The name of the default scheduling algorithm for current Linux systems is [blank_start]Completely Fair Scheduler[blank_end].
- ACompletely Fair Scheduler
123Which of the following are protocols for preventing circular wait?
- AA total ordering is imposed on the resources, and each thread can request resources only in an increasing order of enumeration.
- BIf several instances of the same resource type are needed, a single request for all of them must be issued.
- CWhen a thread requests a resource that cannot immediately be allocated, all resources it is currently holding are preempted.
- DAll of a thread's resources must be allocated before it begins execution.
- EAll of the above.
- FNone of the above.
- GAll resources can be made shareable.
124Which of the following is NOT a potential problem when using monitors?
- AA process might access a resource without first gaining access permission to the resource.
- BA process might never release a resource once it has been granted access to the resource.
- CA process might attempt to release a resource that is never requested.
- DA process might request the same resource twice (without first releasing the resource).
- EA higher-priority process may need to read or modify kernel data that are currently being accessed by a lower-priority process.
125What does the following code result in:
signal(mutex);
...
critical section
...
wait(mutex);- ASeveral processes may be executing in their critical sections simultaneously, violating the mutual-exclusion requirement.
- BMutual-exclusion is preserved.
- CThe process will permanently block on the call to wait()
126What does the following code result in:
wait(mutex);
...
critical section
...
wait(mutex);- ASeveral processes may be executing in their critical sections simultaneously.
- BThe process will permanently block on the second call to wait()
- CMutual-exclusion is guaranteed.
- DThe process never enters its critical section.
127If a set of processes cannot be scheduled by _______________ scheduling algorithm, it cannot be scheduled by any other algorithm that assigns static priorities.
- ARate-monotonic
- BAdmission-control
- CEarliest-Deadline First
- DProportional Share
128If a set of processes cannot be scheduled using rate-monotonic scheduling, it cannot be scheduled by any other algorithm that assigns dynamic priorities.
- ATrue
- BFalse
129The two registers that can be used to provide a simple form of memory protection are the [blank_start]base[blank_end] register and the [blank_start]limit[blank_end] register.
- Abase
- Blimit
130The three different times at which address binding may occur are
[blank_start]compile[blank_end] time, [blank_start]loading[blank_end] time, and [blank_start]execution[blank_end] time.- Acompile
- Bloading
- Cexecution
131An address generated by the CPU is also referred to as a physical address
- ATrue
- BFalse
132The hardware device that maps virtual to physical addresses is called the [blank_start]Memory Management Unit[blank_end].
- AMemory Management Unit
133Fragmentation can still occur in paging systems
- ATrue
- BFalse
134Each entry in the page table contains a [blank_start]page[blank_end] number and a [blank_start]frame[blank_end] number.
- Apage
- Bframe
135The two parts of an address generated by the CPU are the [blank_start]page number[blank_end] and [blank_start]page offset[blank_end].
- Apage number
- Bpage offset
136The term that describes when a page number is not present in the TLB is [blank_start]TLB miss[blank_end].
- ATLB miss
137If a page offset is 13 bits, how large (in bytes) is the page?
- A8192 bytes (8KB)
- B4096 bytes (4KB)
- C256 bytes
- D1GB
138Deadlock prevention and deadlock avoidance are essentially the same.
- ATrue
- BFalse
139A(n) __________ page table has one page entry for each real page (or frame) in memory.
- AInverted
- Bclustered
- Cforward-mapped
- Dvirtual
140Consider a 32-bit address for a two-level paging system with an 8 KB page size. The outer page table has 1024 entries. How many bits are used to represent the second-level page table?
- A10
- B8
- C12
- D9
141Which of the following is not a reason explaining why mobile devices generally do not support swapping?
- ALimited space constraints of flash memory.
- BSmall size of mobile applications do not require use of swap space.
- CLimited number of writes of flash memory.
- DPoor throughput between main memory and flash memory.
142Standard swapping is generally not used in contemporary operating systems, because
- Asome processes are so large that they can't fit in backing store.
- Bmemory in contemporary systems is large enough to store all processes.
- Cthe amount of time required to move entire processes between memory and the backing store is prohibitive.
- Dcontemporary operating systems do not oversubscribe memory.
143Standard swapping involves swapping in pages of processes instead of entire processes.
- ATrue
- BFalse
Information
- Description
- Computer Science Quiz on Operating Systems Quiz 2, created by Jared Baca on 02/04/2023.
- Author
- Jared Baca
- Language
- English
- Views
- 5
- Tags
- Rating
- No ratings yet Rate this quiz