Operating Systems Midterm
A process may transition to the ready state by which of the following options.
- Completion of an I/O event -Awaiting its turn on the CPU -Newly admitted process -All of the above (ALL OF THE ABOVE)
A thread comprises:
- thread ID - program counter - register set - a stack
Ready Queue
set of all processes residing in main memory, ready and waiting to execute
Device Queue
set of processes waiting for an I/O device
A significant problem with priority scheduling algorithms is?
starvation
Asynchronous cancellation
terminates the target thread immediately
What is the disadvantage of Direct Communication scheme?
the limited modularity of the resulting process definitions
What provides an API for creating and managing threads?
thread library
What is the number of processes that are completed per time unit?
throughput
In multithreaded programs, the kernel informs an application about certain events using a procedure known as a(n) ____.
upcall
To the SYSGEN program of an operating system, the least useful piece of information is ________.
what applications to install
In a(n) _______ temporary queue the sender must always block until the recipient receives the message?
zero capacity
Which of the following would be an acceptable signal handling scheme for a multithreaded program?
-Deliver the signal to only certain threads in the -Deliver the signal to every thread in the process. - Deliver the signal to the thread to which the signal applies. - All of these (ALL OF THESE)
What is the relationship between a guest operating system and a host operating system in a system like VMware? What factors need to be considered in choosing the host operating system?
A guest operating system provides its services by mappingthem onto the functionality provided by the host operating system. A key issue that needs to be considered in choosing the host operating system is whether it is sufficiently general in terms of its system-call interface in order to be able to support the functionality associated with the guest operating system.
What is the main advantage of the microkernel approach to system design? How do user programs and system services interact in a microkernel architecture? What are the disadvantages?
Advantages: -Extending the OS is made easier -Fewer changes need to be made when modifying the kernel -OS is easier to port from one hardware design to another Disadvantages: -system function overheads which affect the performance of microkernel -interprocess communication comes with overheads
Many-to-many model
Allows many user level threads to be mapped to many (same number or smaller number of)kernel threads. Allows operating system to create a sufficient number of kernel threads.
Short-term scheduling
selects which process should be executed next and allocates CPU.
Provide programming example in which multithreading does not provide better performance that a single-threaded solution?
Any sequential program or "shell" program such as C-shell or Korn shell
Why should a web server not run as a single-threaded process?
Because then only one client can be serviced at a time and this would cause huge wait times.
Cooperating Process
Can affect or be affected by the execution of another process
Long-term scheduling
selects which processes should be brought into the ready queue
What is a thread pool and why is it used?
Creates a number of threads at process startup and place them into a pool, where they sit and wait for work. Thread pools are used to limit the number of threads that exist at any one point.
One to one model
Each user-level thread maps to kernel thread
What of the following scheduling algorithms must be nonpreemptive?
FCFS (First come first serve)
Load balancing algorithms have no impact on the benefits of processor affinity.
False
Load balancing is typically only necessary on systems with a common run queue.
False
In a virtual machine, each program believes that it has _______.
Its own memory
Many-to-one
Many user-level threads mapped to single kernel thread. Only one thread can access the kernel at a time. Multiple threads are unable to run in parallel of multiprocessors.
The _______ multithreading model multiplexes many user-level threads to a smaller or equal number of kernel threads.
Many-to-many model
Windows uses the ________.
One-to-one model
What is the main advantages for an operating system designer of using a virtual machine architecture?
System is easy to debug, and security problems are easy to solve. VMs provide a good platform for OS research since many OS systems can run on one physical machine.
Thread
The basic unit of program execution. A process can have several threads running concurrently, each performing a different job, such as waiting for events or performing a time-consuming job that the program doesn't need to complete before going on. When a thread has finished its job, the thread is suspended or destroyed. See also process.
What are two models of inter-process communication? What are the strengths and weaknesses of the two approaches?
The message-passing model and the shared memory model. Message passing is slower than shared memory but it is useful for exchanging small amounts of data, and is easier to implement. Shared memory model allows two of more processes to exchange info by reading and writing data in shared memory areas. It offers better convenience of communication. It has security and synchronization issues.
In what ways is the modular kernel approach similar to the layered approach? In what ways does it differ from the layered approach?
The modular kernel approach requires subsystems to interact with each other through carefully constructed interfaces. The layered kernel approach imposes a strict ordering of subsystems such that subsystems at lower layers are not allowed to invoke operations corresponding to upper layer subsystems. These restrictions don't exist in the modular kernel approach.
When a process Cretes a new process using the fork() operation, which of the following state is shared between the parent process and the child process?
The shared memory segments
A traditional process has a single thread of control.
True
Round-robin scheduling degenerates to first-come-first-served scheduling if the time quantum is too long.
True
Thread library provides programmer with API creating and managing threads.
True
Job Queue
set of all processes in the system
Medium-term scheduling
Uses swapping from virtual to physical memory. Used to improve the process mix. Blocked processes can be swapped out of memory to make room for other processes to run.
Deferred cancellation
allows the target thread to periodically check if it should be cancelled
Independent Process
cannot affect or be affected by the execution of another process
What occurs in FCFS scheduling when a process with a long CPU burst occupies the CPU?
convoy effect
If a program terminates abnormally, a dump of memory may be examined by a _______ to determine the cause of the problem.
debugger
Cancellation points are associated with _______ cancellation.
deferred
This list of processes waiting for a particular I/O device is called
device queue
True or False: An initial bootstrap program is in the form of random-access memory (RAM).
false
Which mapping does windows use?
one-to-one model
What allows a thread to run on only one processor?
processor affinity