CSCI 4100

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

What does the UNIX fork system call do? A. Create and initialize the PCB and address space, load the program, copy the arguments, initialize the program counter, and inform the scheduler that the process is ready to run. B. Create and initialize the PCB and address space, copy the contents of the caller's address space, and inform the scheduler that the process is ready to run. C. Load the program into the current address space, copy the arguments, and initialize the program counter. D. Load the program into the current address space, copy the arguments, initialize the program counter, and inform the scheduler that the process is ready to run.

B

What is multitasking? A. Using multiple processors to run a single application. B. Switching between multiple programs in memory. C. Using an interrupt handler to respond quickly to user input. D. Running a sequence of tasks one at a time without interruption.

B

What is the difference between producer-consumer communication and client-server communication? A. Client-server communication only requires a single pipe, producer-consumer communication requires two. B. Producer-consumer communication only requires a single pipe, client-server communication requires two. C. Producer-consumer communication is asynchronous, while client-server communication may block the caller. D. Client-server communication is asynchronous, while producer-consumer communication may block the caller.

B

What structure does a processor use to store the state of the currently running process when an interrupt occurs? A. The interrupt vector table. B. The interrupt stack. C. The interrupt heap. D. The interrupt queue.

B

When a system call is invoked, which of the following is responsible for issuing a trap instruction? A. The user program. B. The user stub. C. The interrupt handler. D. The kernel routine that performs the operation.

B

Which of the following UNIX system calls loads a compiled program into memory and runs it? A. fork B. exec C. wait D. exit

B

Which of the following best describes an OS boot sequence? A. The computer loads the BIOS, the BIOS loads the kernel, and the kernel loads the bootloader. B. The computer loads the BIOS, the BIOS loads the bootloader, and the bootloader loads the kernel. C. The computer loads the bootloader, the bootloader loads the BIOS, and the BIOS loads the kernel. D. The computer loads the bootloader, the bootloader loads the kernel, and the kernel loads the BIOS

B

Which of the following features is provided by a base and bound approach to address translation? A. Fine-grained protection of memory within a process. B. Protection of a process's memory from other processes. C. Memory shared between multiple processes. D. Dynamically expandable memory regions.

B

Which of the following is a hardware event caused by user program behavior? A. A hardware interrupt. B. A processor exception. C. An upcall. D. A system call.

B

Which of the following is not a property that a lock should guarantee? A. Only one thread can hold the lock at a time. B. A thread holding a lock can not be suspended by the thread scheduler. C. If no thread holds the lock, some thread can acquire it. D. The number of threads that can acquire a lock before a thread that has attempted to acquire it is bounded.

B

Which of the following is not an example of a priveleged instruction? A. Disabling interrupts. B. Multiplying two numbers. C. Creating a process. D. Terminating a process.

B

Which of the following operations is provided by a condition variable to remove one thread from the waiting list? A. wait B. signal C. broadcast D. release

B

Which of the following refers to programs that tend to reference data near other recently accessed data? A. Temporal locality. B. Spatial locality. C. Virtual locality. D. Physical locality.

B

Which of the following replacement policies evicts the block that will be used the farthest in the future? A. FIFO B. MIN C. LRU D. LFU

B

Which of the following roles is an operating system playing when it gives each application its own set of unlimited contiguous memory addresses? A. Referee (managing resources) B. Illusionist (abstracting the hardware) C. Glue (providing common services) D. None of the above

B

Assume there are two threads that share a variable called balance where: The initial value of balance is 1000 Thread 1 executes the code balance = balance + 500; Thread 2 executes the code balance = balance + 200; What are the possible values of balance after both threads complete? A. 1700 B. 1200 or 1500 C. 1200, 1500, or 1700 D. 0, 1200, 1500, or 1700

C

Consider the following solution to the Too Much Milk problem: 1. The roommate checks if there is milk in the fridge. 2. If there is no milk, the roommate checks to see if the other roommate has left a note. 3. If there is no note, the roommate leaves a note and goes to the store to buy milk. 4. If there is a note, the roommate does not go to the store. Which of the conditions does this algorithm satisfy? A. It satisfies the liveness condition, but not the safety condition. B. It violates both safety and liveness. C. It satisfies the safety condition but not the liveness condition. D. It satisfies both the safety condition and the liveness condition.

C

In the Banker's Algorithm, what indicates an unsafe state? A. For any possible set of resource requests, there is at least one ordering that does not lead to deadlock. B. For any possible set of resource requests, there is at least one ordering that leads to deadlock. C. There is at least one set of resource requests that leads to deadlock regardless of the ordering. D. There is at least one set of resource requests that does not lead to deadlock regardless of the ordering.

C

What does the UNIX exec system call do? A. Create and initialize the PCB and address space, load the program, copy the arguments, initialize the program counter, and inform the scheduler that the process is ready to run. B. Create and initialize the PCB and address space, copy the contents of the caller's address space, and inform the scheduler that the process is ready to run. C. Load the program into the current address space, copy the arguments, and initialize the program counter. D. Load the program into the current address space, copy the arguments, initialize the program counter, and inform the scheduler that the process is ready to run.

C

What happens when an invalid virtual address is accessed? A. A cache hit. B. A TLB shootdown. C. A page fault. D. The process making the access is terminated.

C

What is a memory-mapped file? A. A file that is used as a backup for the pages in the virtual address space of a process. B. A file that contains the page table for a process. C. A file that is accessed directly through the virtual address space of a process. D. A file that is accessed indirectly through a kernel buffer in memory.

C

What is the difference between semaphores and condition variables? A. Semaphores can be used to make a thread wait until a condition holds. B. A thread can perform an operation on a semaphore that results in a thread being removed from a waiting queue. C. Semaphores maintain state other than a waiting list. D. Semaphore operations are atomic

C

What is the purpose of a core map? A. It translates page numbers to frame numbers. B. It keeps track of the locations of the page tables for each segment. C. It keeps track of all of the page table entries that refer to a given page frame. D. It keeps track of a list of memory objects such as executable programs, shared data, and libraries.

C

What makes a scheduler work-conserving? A. It favors compute-bound tasks over I/O-bound tasks. B. It favors I/O-bound tasks over compute-bound tasks. C. It never leaves the processor idle when tasks are available. D. It has the ability to preempt the processor and give it to another task.

C

When an interrupt occurs, which of the following does not need to be saved before jumping to the interrupt handler code? A. The stack pointer. B. The program counter. C. The handler address. D. The status register.

C

Which of the following RWLock operations will block the caller if a reader has acquired the RWLock? A. startRead B. doneRead C. startWrite D. doneWrite

C

Which of the following approaches breaks a cache into buckets, each of which contains a fixed number of entries? A. A fully associative cache. B. A direct mapped cache. C. A set associative cache. D. None of the above.

C

Which of the following approaches uses multiple kernel threads to support multiple user threads sharing the same address space? A. Kernel threads. B. Single-threaded user processes. C. Multi-threaded user processes. D. User-level threads.

C

Which of the following assumptions is safe to make when programming with threads? A. The amount of time it takes for operations to complete is determined entirely by the code a thread is running. B. The operations performed by a multi-threaded program will always be executed in the same order. C. A thread can be suspended at any time regardless of what the thread is doing. D. If a thread yields the processor it is running on, it knows which thread will run next.

C

Which of the following best describes a deadlock? A. Multiple threads modify data, leaving it in an inconsistent state. B. A thread is made to wait until another thread performs an action. C. A group of threads is waiting for an action that only one of the threads in the group can perform. D. Threads take turns running on a processor until all threads have completed.

C

Which of the following best describes a spinlock? A. A uniprocessor lock that disables interrupts when it is acquired and enables them when it is released. B. A uniprocessor lock that maintains a state variable and a waiting list. C. A multiprocessor lock that uses an atomic read-modify-write operation to maintain a state variable. D. A multiprocessor lock that maintains a state variable and a waiting list.

C

Which of the following best describes a synchronization barrier? A. A synchronization object that provides mutual exclusion. B. A synchronization object used by threads to wait for a condition to be true. C. A shared object used to make a thread wait for the rest of a set of threads to complete a task. D. A shared object used to buffer items so that they are removed in a strict order.

C

Which of the following best describes how dirty bits are maintained in a page table? A. A dirty bit is initialized to one, set when the page is written to, and cleared when the page is flushed to disk. B. A dirty bit is initialized to one, set when the page is referenced, and cleared periodically by a clock algorithm. C. A dirty bit is initialized to zero, set when the page is written to, and cleared when the page is flushed to disk. D. A dirty bit is initialized to zero, set when the page is referenced, and cleared periodically by a clock algorithm.

C

Which of the following does not result in a switch from user mode to kernel mode? A. A hardware interrupt. B. A processor exception. C. An upcall. D. A system call.

C

Which of the following is not a requirement of a cache? A. Efficient access to the cached copy of data. B. A replacement policy to determine which old entry to evict when a new entry is brought in. C. Copies of all of the original data in the cache. D. Coherence of the cache when cached copies are no longer valid.

C

Which of the following is responsible for copying and checking the arguments of a system call? A. The user program. B. The user stub. C. The kernel stub. D. The kernel's implementation of the system call.

C

Which of the following operations waits for another thread to complete its task? A. thread_create B. thread_yield C. thread_join D. thread_exit

C

Which of the following parts of an operating system is responsible for providing protection? A. The user interface. B. Device drivers. C. The kernel. D. Utility programs.

C

Which of the following replacement policies evicts the block that was used furthest in the past? A. FIFO B. MIN C. LRU D. LFU

C

Which of the following uses upcalls to notify an application that a processor has become available? A. Oblivious scheduling. B. Gang scheduling. C. Scheduler activations. D. Energy-aware scheduling

C

Event-driven programming is a form of which of the following lock design patterns? A. Fine-grained locking. B. Per-processor data structures C. The ownership design pattern. D. Staged architecture.

D

Fault isolation can impact which of the following design goals? A. Reliability. B. Availability. C. Security. D. All of the above.

D

How is Windows process creation different from UNIX process creation? A. Windows allows user programs to create and manage their own processes, while UNIX does not. B. UNIX allows user programs to create and manage their own processes, while Windows does not. C. Windows uses two separate system calls to create a new process, while UNIX only uses one. D. UNIX uses two separate system calls to create a new process, while Windows only uses one.

D

In a virtual machine, what happens when a process running on the guest OS make a system call? A. It traps to the guest kernel, which performs the system call, while the host kernel performs the mode switch. B. It traps to the guest kernel, which handles the mode switch, while the host kernel performs the system call. C. It traps to the host kernel, which performs the system call, while the guest kernel performs the mode switch. D. It traps to the host kernel, which handles the mode switch, while the guest kernel performs the system call.

D

In the Dining Philosophers problem, which of the following strategies eliminates cycles? A. Every philosopher picks up their left fork first. B. Every philosopher picks up their right fork first. C. Every philosopher puts down their left fork if their right is unavailable. D. Every philosopher picks up their lower-numbered fork first.

D

What is the disadvantage of a bounded queue implementation with a lock as its only synchronization variable? A. It does not provide mutual exclusion. B. Adding an item to a queue is not thread safe. C. Removing an item from a queue is not thread safe. D. A busy wait is required to make sure an operation is performed.

D

What is the main advantage of a Shortest Job First (SJF) scheduling policy over a First In First Out (FIFO) scheduling policy? A. SJF is simpler to implement than FIFO. B. SJF prevents starvation. C. SJF is more fair than FIFO. D. SJF minimizes average response time.

D

What is virtual memory? A. A file that is accessible directly in a program's virtual address space. B. A low-latency device that stores recently accessed data from a higher-latency device. C. A cache in memory for blocks of data stored on disk. D. A backup on disk of every memory segment of every running process.

D

When a kernel creates a new process, which of the following actions is performed while in user mode? A. Allocating the PCB. B. Copying the program into memory. C. Copying command-line arguments into user memory. D. Calling a stub that calls the program's main function.

D

Which of the following approaches to page translation is used by the x86 family of processors? A. Segmentation. B. Paged segmentation. C. Multi-level paging. D. Multi-level paged segmentation.

D

Which of the following best describes a FIFO Blocking Bounded Queue? A. A synchronization object that provides mutual exclusion. B. A synchronization object used by threads to wait for a condition to be true. C. A shared object used to make a thread wait for the rest of a set of threads to complete a task. D. A shared object used to buffer items so that they are removed in a strict order.

D

Which of the following best describes a time-sharing operating system? A. A multiuser system that operates on a queue of jobs. B. A system that supports multiple simultaneous network connections. C. A set of I/O routines for a single user system. D. A system that processes input events to support interactive computing.

D

Which of the following does not need to be saved before jumping to the handler code on an interrupt? A. The stack pointer. B. The program counter. C. The status register. D. The handler address.

D

Which of the following is difficult to do using a base-and-bound approach to protecting memory? A. Determine if a memory access is within the accepted address range. B. Keeping track of the memory allocated to each process. C. Giving the kernel unlimited access to memory. D. Relocating a process to another location in memory.

D

Which of the following is not a potential problem caused by parallel access to shared data structures with locks on multiprocessor systems? A. A lock on a shared data structure can become a bottleneck. B. Shared data must be copied from one processor cache to another. C. False sharing of multiple data structures in the same cache block. D. Race conditions may occur when two threads access the shared data concurrently.

D

Which of the following is not true about threads? A. Each thread behaves as if it has its own dedicated processor. B. Only a subset of threads may be running at a given time. C. A single thread executes its instructions sequentially. D. Every thread operates in its own separate address space.

D

Which of the following performance metrics measures the amount of useful work done in a given amount of time? A. Overhead. B. Fairness. C. Response time. D. Throughput.

D

Which of the following refers to a cache where updates are sent to memory when the cache evicts a block that has been written to? A. Prefetching. B. On-demand. C. Write-through. D. Write-back.

D

Which of the following system services must be implemented by the kernel? A. Window management. B. The network protocol stack. C. Managing the file system. D. Protecting process from each other.

D

Which part of the memory allocated to a process is responsible for storing dynamically allocated data? A. The machine instructions. B. The static data. C. The execution stack. D. The heap.

D

What is the difference between independent threads and cooperating threads? A. Independent threads operate on different subsets of memory, while cooperating threads read and share state. B. Independent threads read and share state, while cooperating threads operate on different subsets of memory. C. Independent threads perform their tasks sequentially while cooperating threads perform their tasks concurrently. D. Independent threads perform their tasks concurrently while cooperating threads perform their tasks sequentially.

A

What is the difference between user mode and kernel mode? A. In user mode, the processor checks if instructions are permitted before executing them. In kernel mode no such checks are performed. B. In kernel mode, the processor checks if instructions are permitted before executing them. In user mode no such checks are performed. C. In user mode, multiple instructions can be executed at the same time. In kernel mode only one instruction can be executed at a time. D. In kernel mode, multiple instructions can be executed at the same time. In user mode only one instruction can be executed at a time.

A

What is the primary tradeoff that determines the memory hierarchy on a computer system? A. Small, fast, and expensive memory vs. large, slow, and cheap memory. B. Small, fast, and cheap memory vs. Large, slow, expensive memory. C. Small, slow, and expensive memory vs. large, fast, and cheap memory. D. Small, slow, and cheap memory vs. Large, fast, and expensive memory.

A

What structure does a processor use to determine what code to run when an interrupt occurs? A. The interrupt vector table. B. The interrupt stack. C. The interrupt heap. D. The interrupt queue.

A

When implementing a shared object, when should a lock be acquired and released? A. A lock should be acquired at the beginning of every public method and released at the end of every public method. B. A lock can be acquired at any time in a method as long as it is released at the end. C. A lock can be released at any time in a method as long as it is acquired at the beginning. D. A lock must be acquired before it is released, but otherwise both operations can be used at any point in the method.

A

Which of the following UNIX system calls creates a child process that is a complete copy of the calling process? A. fork B. exec C. wait D. exit

A

Which of the following best describes a batch operating system? A. A multiuser system that operates on a queue of jobs. B. A system that supports multiple simultaneous network connections. C. A set of I/O routines for a single user system. D. A system that processes input events to support interactive computing.

A

Which of the following best describes how a shell executes a command? A. The shell calls fork, the child process calls exec, and the parent process calls wait. B. The shell calls fork, the child process calls wait, and the parent process calls exec. C. The shell calls exec, the child process calls fork, and the parent process calls wait. D. The shell calls exec, the child process calls wait, and the parent process calls fork.

A

Which of the following best describes how the Banker's Algorithm avoids deadlock? A. Requests are granted if they keep the system in a safe state and delayed if they would put the system in an unsafe state. B. Requests are granted if they keep the system in a safe state and delayed if they would put the system in an deadlocked state. C. Requests are always granted. D. Requests are never granted

A

Which of the following best describes the process of address translation? A. A virtual address used by a program is translated to a physical address in memory. B. A physical address used by a program is translated to a virtual address in memory. C. A virtual address in memory is translated to a physical address used by a program. D. A physical address in memory is translated to a virtual address used by a program.

A

Which of the following does not result in a switch from kernel mode to user mode? A. An interrupt is generated by an I/O device. B. A process is loaded into memory and is ready to execute its first instruction. C. The kernel switches from the current process to a different process. D. The kernel finishes processing an interrupt.

A

Which of the following is not a good reason to use concurrency? A. It improves the security of a system. B. It improves the responsiveness of user interfaces. C. It helps mask the latency of disk and network operations. D. It improves overall system performance.

A

Which of the following is not a necessary condition for deadlock? A. Each thread is running on a different processor. B. A thread can hold one resource while waiting for another resource. C. Once a thread holds a resource, it's ownership can not be revoked. D. A finite number of threads can simultaneously access a resource.

A

Which of the following is not an effective way to detect a deadlock? A. Count the number of waiting threads. B. Determine if an operation is taking an unusually long amount of time. C. Construct a graph of threads and resources and determine if a cycle exists. D. Use a version of the Banker's Algorithm to determine if pending requests can not be satisfied.

A

Which of the following operations may move a thread from the RUNNING state to the WAITING state? A. acquire B. release C. signal D. broadcast

A

Which of the following performance metrics measures the additional resource cost of implementing an abstraction? A. Overhead. B. Fairness. C. Response time. D. Throughput.

A

Which of the following roles is an operating system playing when it determines which application should run next on a processor? A. Referee (managing resources) B. Illusionist (abstracting the hardware) C. Glue (providing common services) D. None of the above

A

Breaking up a process's memory into fixed-sized pieces.

paging

A kernel buffer that can be written to by one process and read from by another process.

pipe

The execution of an application with restricted rights.

process

Preventing applications from corrupting other applications.

protection

An OS does what it is designed to do.

reliability

Breaking up a process's memory into variable-sized pieces.

segmentation

Uses demand paging to manage multiple processes in memory.

virtual memory

In an x86 mode transfer, which of the following is not the responsibility of the interrupt handler? A. Saving the three critical registers. B. Saving the remaining registers. C. Restoring the three critical registers. D. Restoring the remaining registers.

A

Multi-threaded processes can be implemented without kernel support beyond the use of upcalls. A. True B. False

A

Splitting shared objects into separate objects each with its own lock can improve performance. A. True B. False

A

The choice of which thread to schedule next is a matter of thread scheduling policy, which is independent of the mechanism used to switch between threads. A. True B. False

A

What does the Windows CreateProcess system call do? A. Create and initialize the PCB and address space, load the program, copy the arguments, initialize the program counter, and inform the scheduler that the process is ready to run. B. Create and initialize the PCB and address space, copy the contents of the caller's address space, and inform the scheduler that the process is ready to run. C. Load the program into the current address space, copy the arguments, and initialize the program counter. D. Load the program into the current address space, copy the arguments, initialize the program counter, and inform the scheduler that the process is ready to run.

A

What is a translation lookaside buffer (TLB)? A. A cache in hardware that contains the results of recent address translations. B. A cache in hardware indexed by virtual address that contains program data and/or instructions. C. A cache in hardware indexed by physical address that contains program data and/or instructions. D. A table in memory that maps page numbers to frame numbers.

A

What is a working set? A. A critical mass of data that is accessed by a program most frequently. B. A distribution of accesses where the frequency roughly the inverse of the popularity rank. C. The set of data that fits in a cache at any given time. D. The most recently accessed data at any given point in time.

A

What is the difference between a monolithic kernel and a microkernel? A. A monolithic kernel implements most OS functionality inside the kernel, while a microkernel implements as much functionality as it can with user-level services. B. A microkernel implements most OS functionality inside the kernel, while a monolithic kernel implements as much functionality as it can with user-level services. C. A monolithic kernel uses a hardware abstraction layer, while a microkernel uses dynamically loadable device drivers. D. A microkernel uses a hardware abstraction layer, while a monolithic kernel uses dynamically loadable device drivers.

A

What is the difference between acquire-all/release-all and two-phase locking A. In two-phase locking, locks can be acquired as needed. B. In two-phase locking, locks must be acquired before any other operations are performed. C. Two-phase locking is serializable. D. Two-phase locking allows a lock to be acquired after another lock has been released.

A

Uses demand paging to provide direct access to a file in memory.

memory-mapped file

Manages a computer's resources and virtualizes the hardware.

operating system

The conversion of a virtual address to a physical address.

address translation

The percentage of time an OS is usable.

availability

A copy of a computation or data that can be accessed more quickly than the original.

cache

Represents an open file, device, or communication channel

file descriptor

The part of the OS that provides protection

kernel


Kaugnay na mga set ng pag-aaral

Chapter 7: Aggregate Demand/Suppy

View Set

CS 219 Chapter 13.1 Addressing Modes

View Set

Chapter 1, 2 & 3 - CompTIA Security+

View Set

Med Surg II - Chapt 66 - Management of Pts with Neurologic Dysfunction

View Set