FInal Review
i execution time priority 0 80 3 1 20 1 2 10 4 3 20 5 0 50 2 Assume that you use priority scheduling where a small integer means a higher priority. Also assume that all processes arrive at time 0. The execution time is in ms. Process #____ will be scheduled first;
1
Which of the choice include all possible outcomes of the following program? x is initialized to 0. Thread A Thread B x = x + 1; x = x + 2; - 1,3 - 2,3 - 1,2,3 - 1,2
1,2,3
i execution time priority 0 80 3 1 20 1 2 10 4 3 20 5 0 50 2 Assume that you use priority scheduling where a small integer means a higher priority. Also assume that all processes arrive at time 0. The execution time is in ms. Process #0 finishes at ____ ms;
150
i execution time priority 0 80 3 1 20 1 2 10 4 3 20 5 0 50 2 Assume that you use priority scheduling where a small integer means a higher priority. Also assume that all processes arrive at time 0. The execution time is in ms. The total response time (waiting time plus execution time) for process #2 is ____ ms;
160
i execution time priority 0 80 3 1 20 1 2 10 4 3 20 5 0 50 2 Assume that you use priority scheduling where a small integer means a higher priority. Also assume that all processes arrive at time 0. The execution time is in ms. The waiting time of Process #3 is ____ ms;
160
Most operating systems allocate how many stack(s) for interrupted processes? - 0 - 1 - 2 - 3
2
Involuntary kernel thread context switch follows three steps of what order? 1. Run the kernel's handler 2. Restore the state 3. Save the state
2,3,1
i execution time priority 0 80 3 1 20 1 2 10 4 3 20 5 0 50 2 Assume that you use priority scheduling where a small integer means a higher priority. Also assume that all processes arrive at time 0. The execution time is in ms. The average waiting time of all processes is ____ ms;
80
Kernel to user mode transfer can be triggered due to - Resume after an interrupt - Switch to a difference process - New process - ALL OF ABOVE
ALL OF ABOVE
All of the following are atomic operations except - Unix file open, i.e., check if it exists, create if it does not exist, and then open the file - Test and Set instruction - Acquire all or none -Lock acquire and release
Acquire all or none
The correct order of operations for UNIX file open is: , , . A: open the file B: test if the file exits C: optionally create it if it does not exist
B, C, A
Which of the following operating system works on a queue of tasks. It runs a simple loop: load, run, and unload each job in turn. - Time sharing - Batch - Real time - Modern
Batch
The four conditions of deadlocks are:
Bounded resources No Preemption Wait While holding Circular waiting
Given the cost of address translation as CAT, cost of TLB lookup as CTLBL, cost of a full translation as CFT, and the likelihood that TLB has the entry cached as P(hit), then we can calculate CAT as CAT =
CTLBL + CFT x (1-P(hit))
Which of the following is NOT a typical role an operating system plays? -Referee -Illusionist -Controller -Glue
Controller
Which of the following functions is NOT a UNIX system call? - CreateProcess - exec() - wait() - signal()
CreateProcess
Which of the following does Multi-level feedback CPU scheduling does not achieve? Which of the following does Multi-level feedback CPU scheduling does not achieve? -Responsiveness -Deadline Assurance -Starvation-Freedom -Fairness
Deadline Assurance
Banker's algorithm is a solution of which of the following type - Deadlock avoidance - Deadlock recovery - Deadlock detection - Deadlock prevention
Deadlock avoidance
Define: Multiple multi-threaded user processes
Each with multiple threads, sharing same data structures, isolated from other user processes
Out of the three files systems: FAT, FFS, and NTFS, please answer the following question: uses linked list as its index structure
FAT
Out of the three files systems: FAT, FFS, and NTFS, please answer the following question: uses block groups for its locality heuristics.
FFS
Out of the three files systems: FAT, FFS, and NTFS, please answer the following question: was released in Unix OS
FFS
Among the scheduling algorithms of FIFO, SJF, RR, and Max-Min, please answer the following question: does not cause starvation and is better than RR on total response time (waiting time plus execution time).
FIFO
A thread can delete itself when finished.
False
Deadlock happens mostly due to inappropriate OS implementation by programmers.
False
FFS usually store small files in contiguous file blocks.
False
In a green thread, the kernel is aware of the state of user-level ready list.
False
In google chrome, a new thread is created every time a new tab is opened.
False
Lock variable is sufficient to solve all synchronization problems.
False
The interrupt hander is a kind of kernel thread.
False
Unix fork returns only in the main thread.
False
After being put in the ready list, a thread may be in four states that include,
Finished Ready Running Waiting
A thread's life cycle starts with ____ state, then switch to ____state when put in the ready list, then switched to ____state after being scheduled. At ____ state, a thread may terminate and switch to ____ state, or suspend due to I/O and switch to ____state, or yield the CPU and entered into ____ state.
Init Ready Running Running Finished Waiting Ready
UNIX fork does all the following except - Initialize the address space with a copy of only part of the contents of the address space of the parent - Inherit the execution context of the parent - Create a new address space - Create and initialize the process control block in the kernel
Initialize the address space with a copy of only part of the contents of the address space of the parent
Which of the following is FALSE regarding the operation: "file open, i.e., check if it exists, create if it does not exist, and then open the file"? - It consists of multiple separate instructions - It cannot be interrupted - It's defined in Unix system - It's designed to avoid potential errors
It consists of multiple separate instructions
A page frame is "dirty" if
It has been modified
At a minimum, the hardware must support the following except - Memory protection - Kernel threads - Timer interrupts - Priviledged instructions
Kernel threads
Among the scheduling algorithms of FIFO, SJF, RR, and Max-Min, please answer the following question: helps correct the unfairness for IO-bound threads when round robin is applied
Max-Min
Which of the following is NOT an advantage of memory-mapped files? - Much faster than traditional file I/O -Transparency -Zero copy I/O -Efficient with large file I/O
Much faster than traditional file I/O
All of the following can be used to implement multi-threaded processes except -User-level threads without kernel support -Multi-threaded processes using kernel processes -Multi-threaded processes using kernel threads -User-level threads with kernel support
Multi-threaded processes using kernel processes
All of the following are possible approaches of inter-process communication except - Multi-threading - File read/write - Network messaging - pipe
Multi-threading
Define: Multiprocess kernel
Multiple single-threaded processes System calls access shared kernel data structures
Given N, the number of tasks that are either waiting in the queue or being processed by the CPU, arrival rate Y, and response time R, what is the relationship between N, Y, R in a stable system?
N=YR
Out of the three files systems: FAT, FFS, and NTFS, please answer the following question: uses a dynamic tree as its index structure
NTFS
Which file system uses "Extent" for data storage? - NTFS - FFS - FAT
NTFS
Almost all multi-level address translation systems use the following as the lowest level of the tree:
Paging
At a minimum, the hardware must support
Privileged Instructions Memory Protection Timer Interrupts
Among the scheduling algorithms of FIFO, SJF, RR, and Max-Min, please answer the following question: overhead when frequently perform involuntary time interrupts of threads when a specific time slice is being used
RR
Among the scheduling algorithms of FIFO, SJF, RR, and Max-Min, please answer the following question: usually end up all processes/threads finish around the same time if they arrive at the same time and have the same execution time
RR
Among the scheduling algorithms of FIFO, SJF, RR, and Max-Min, please answer the following question: may cause starvation and can be resolved with aging technique
SJF
Which of the following is not a possible option for Multi-thread Process Implementation? -Using kernel threads -Single-threaded processes -User-level threads with kernel support -User-level threads without kernel support
Single-threaded processes
A lock should ensure the following three properties except - Progress - Mutual exclusion - Thread ordering - Bounded waiting
Thread Ordering
Kernel threads
Thread abstraction only available to kernel To the kernel, a kernel thread and a single threaded user process look quite similar
Thread TCB includes the following information except - Thread stack - Thread source code - Copy of processor registers - Per-thread metadata
Thread source code
Almost 90% system crashes were due to device drivers, not operating systems itself.
True
Almost all commercial operating systems today support kernel-supported threads.
True
Almost all widely used operating systems take a similar approach to the architecture of the kernel where most of the OS functionalities run inside the kernel.
True
Code based on semaphores is not uncommon, especially in operating systems.
True
Every memory segment still uses an array of pairs of base and bound registers for its organization.
True
If an individual thread is unable to take advantage of the overlap of CPU and I/O operations, the OS can overlap the CPU execution of one thread with the I/O operation of other threads.
True
The earliest implementations of Java Virtual Machine (JVM) implements a green thread, which is a pure user-level implementation.
True
most system crashes are due to bugs in device drivers rather than in the operating system itself.
True
The three steps to create a thread include:
allocate per-thread state initiate per-thread state put TCB on ready list
A ____ operating system works on a queue of tasks. It runs a simple loop: load, run, and unload each job in turn.
batch
The three operations on a condition variable are
broadcast signal wait
Which of the following is an alternative to interrupts, i.e., the kernel loops, checking each input/output device to see if an event has occurred that requires handling. - buffering - waiting - threading - polling
buffering
Which of the following is NOT a step performed by UNIX exec? initialize the hardware context to start execution at "start". -create a child process -copy arguments into memory in the address space. -load the program prog into the current address space
create a child process
With regard to minimizing queuing delay, which scenario is best case? -bursty arrival -exponential arrivals -evenly spaced arrivals -poisson arrivals
evenly spaced arrivals
An alternate approach to threading is ____-driven programming.
event
An alternative approach to multi-threading for concurrency is called ____-driven programming, which uses asynchronous I/O.
event
An alternative approach to multi-threading for concurrency is called ___-driven programming, which uses asynchronous I/O.
events
For NTFS, please answer the following: Rather than tracking individual file blocks, NTFS tracks ____, variable-size regions of files that are each stored in a ___ region on the storage device.
extent contiguous
Which statement is correct for Hoare's Semantics on condition variable implementation? -if(!condition) then wait -while(!condition) then wait -if(condition) then wait -while(condition) then wait
if(condition) then wait
Involuntary thread context switch has to perform three steps including (i) Chooses another thread to run; (ii) Save the state of the running thread; (iii) Restoring the state of the thread to the processor. The correct order of the steps is:
ii, i, iii
In FFS, each file's tree is rooted at an ____ that contains the file's metadata. Typically, it contains ____ pointers, where ____ pointers are direct pointers with a total of up to a little over ____ KB.
inode 15 12 48
Three typical reasons for user to kernel mode transfer include
iterrupts processor exceptions system calls
Define: Multi-threaded kernel
multiple threads, sharing kernel data structures, capable of using privileged instructions
The three "formal" properties "M-P-B" that must be satisfied for a lock are ____, ____, and ____, respectively.
mutual exclusion progress bounded waiting
Kernel to user mode transfer can be triggered due to....
new processes Resume after an interrupt, processor exception, or system call Switch to a different process User-level upcall
For NTFS, please answer the following: If a file is huge, a file's ____ list can be made ___ , allowing almost arbitrarily large number of MFT records.
nonresident
Which memory address translation strategy is used as the lowest level of all multi-level address translation systems?
paging
Which of the following strategy causes internal fragmentation? - paging - segmentation - caching - memory bitmap
paging
The data structure that stores all the information the operating system needs about a particular process is called
process control block
The data structure that stores all the information the operating system needs about a particular process is called ___, and similarly, the data structure that stores all the information the operating system needs about a particular thread is called ___.
process control block thread control block
The three roles an operating system plays include
referee illusionist glue
For NTFS, please answer the following: If a file is small, the data attribute may be used to store the file's actual contents in its MFT record as a ____ attribute.
resident
For NTFS, please answer the following: A ____ attribute stores its contents directly in MFT record while a ____ attribute store extent pointers in its MFT record and stores its contents in those extents.
resident nonresident
____ is used to unblock one waiting thread and ____ is used to unblock "all" waiting threads for a specific variable.
signal broadcast
The four thread functions in the simple threads API are:
thread_create thread_yield thread_join thread_exit
Which of the following functions is called for the main thread to wait for the termination of a child thread? - thread_join - thread_exit - thread_block - thread_wait
thread_join
We use ___ to refer to any synchronous transfer of control from user mode to kernel.
trap
Most operating systems allocate both a ____ stack and ____ stack for interrupted processes.
user kernel
In ____ mode, the processor checks each instruction before executing it to verify that it is permitted to be performed by that process. In ____ mode, the operating systems executes with protection checks turned off. Together, this is called ____-mode operation.
user kernel dual
In ____ mode, the processor checks each instruction before executing it to verify that it is permitted to be performed by that process. In ____mode, the operating systems executes with protection checks turned off. Together, this is called ____-mode operation.
user kernel dual
There are two types of kernel thread context switch:
voluntary involuntary
Which of the following is correct for condition variable "wait" function? -wait(*lock) -wait() -wait(lock) -wait(&lock)
wait(&lock)
If the cache is ____, then updates can be stored in the cache, and only sent to memory when the cache runs out of space and needs to evict a block to make room for a new memory block.
write-back
If a cache is ____, then all updates are sent immediately onward to memory.
write-through