Fichas
Operating Systems

Fichas del conjunto (133)
- 1What type of abstractions do operating systems provide?1) Processes.
2) Virtual memory
3) Files
4) System call interface - 2What is bootstrapping?Bootstrapping is the execution of a program which typically exists in ROM to load the operating system files from persistent storage into main memory.
- 3Is ROM volatile?No
- 4What does BIOS stand for?Basic Input Output System.
- 5Bootstrapping

- 6What does MBR stand for?Master Boot Record.
- 7What does the MBR do?The MBR points to the bootsector of the operating system which in turn loads and runs the bootloader from its filesystem.
- 8What is a process?A process is a program in execution.
- 9Explain the creation of a process.The creation of a process involves loading an executable file from secondary storage into primary memory (RAM).
- 10In regards to processes, what are some of the duties of an operating system?1) Process creation.
2) Handling concurrency.
3) Scheduling.
4) Coordination of resource requests.
5) Synchronization.
6) Signaling of events (e.g. I/O).
7) Inter-process communication (IPC). - 11Name a few facts about processes.1) Processes can be created and killed.
2) Processes can have children.
3) A process is more than just a program. - 12When is a process created?Whenever some kind of program is started. This can include: OS startup, OS starting a service (daemon), user login, user opening an application, and when a process creates another child process.
- 13Explain the parent and child relationship of processes.1) A process becomes a parent when it creates other processes.
2) Child processes receive resources from their parent or independently from the OS.
3) Flexible execution: Parent and child can either run concurrently, or the former waits for the latter to finish.
4) Flexible use of address space: The child can be directly derived from the parent (a copy of the same program & data) or run an entirely different program.
5) Related system call (UNIX): fork - 14How is process management achieved?1) The OS maintains a process table to keep track of active processes.
2) For each process, a process image is stored in virtual memory, which contains all relevant info about its state. - 15What is a process image?A process image contains all relevant info about the state of the process in virtual memory.
- 16What is inside a process image?

- 17What is the use case of virtual address space?

- 18What is ECF and what is it for?ECF means Exceptional Control FLow and is essentially OS level exceptions. These exceptions include: Interrupt, Trap, Fault, and Abort.
ECF is the underlying mechanism for how operating systems control the execution of processes. - 19When does a Trap exception occur?When switching from user mode to kernel mode using system calls.
- 20Exception handling.

- 21Where to exception handlers run?In kernel mode.
- 22How does the OS identify exception?With the exception's unique number.
- 23What causes a Fault exception?

- 24What causes an Abort exception?

- 25What is a process switch?

- 26How does a process switch work?

- 27Explain the basic process life cycle.

- 28What happens when a process is terminated?It is removed from the process table.
- 29What are the possible causes for the termination of a process?1) Program finished - job done.
2) Programmatic error routine - e.g., exception handling.
3) An unexpected fatal error - e.g., division by 0, illegal memory reference, etc.
4) Killed by another process - requires authorization.
5) Related system calls: exit, kill - 30What kind of info is stored in a process image and what is this used for?The process image stores all the info about a process that is worthwhile knowing in virtual memory so context switches can occur.
- 31How do processes share a computer's memory?Using virtual address spaces for every process which are mapped to different physical address spaces in main memory.
- 32Where are exceptions handled?In the kernel mode using the exception handler.
- 33What is the significance of a mode switch in ECF?ECF enables the OS to run programs concurrently.
- 34What happens during a process switch?The running process is stopped and saved as a process image when preempted and the next process is loaded from the process image in virtual memory and allocated CPU time.
- 35In regards to processes, what is swapping and what is it useful for?If there are many processes running on an OS and there is one processes that only runs every 10 minutes, the process image is stored in storage to optimize the use of main memory.
- 36What does the fork() & exec() system calls do?Fork() creates an identical child copy of the parent process.
Exec() transfers control to the child process. - 37What happens to a child process if the parent process dies?If the parent process dies because it has finished, then the child processes die too. Otherwise the child process becomes and orphan which results in the orphan process to be allocated a foster parent (in Linux the foster parent is the "init" process).
- 38A process creates a child process. Explain what happens to both parent and child process.

- 39How does a child process know it is a child process?All child processes are given the process ID 0.
- 40What happens if a child process exits before the parent gets a chance to issue the wait() system call?The child process becomes defunct, or "zombies". They cannot be killed but remain on the process table in terminated state until the parent calls wait() to retrieve their exit status.
- 41A brief comparison of Processes and Threads.

- 42Name two components which processes and threads have in common.Both have a control block and an ID.
- 43What makes threads more light-weight than processes?Because threads do not need to do any resource management. They simply access the memory and resources that come with their processes.
- 44What is the minimum amount of threads a process will have.At least 1.
- 45Single vs multi-threaded processes.

- 46Basic explination of threads.Threads are like little sub-processes of a single larger process.
- 47What are the advantages of running multiple threads on multiple cores?

- 48What is the disadvantage of running threads on a single-core CPU?Single-core CPUs effectively switch between threads as if they were processes.
- 49On average, how much faster can a thread be created than a process?Up to 30 times faster.
- 50Name some of the general advantages of threads.1) Lightweight management which includes:
A) Faster creation than processes.
B) Faster context switches.
C) Faster Termination.
2) Lightweight communication which includes:
A) shared resources with the same address space.
B) Direct communication with the process.
3) Application responsiveness which includes:
A) User requests have less impact on execution of performance.
B) Expensive computation can run separately. - 51What are the three states a thread can be in?1) Ready (waiting for execution)
2) Running (executing code)
3) Blocked (waiting for something to happen, i.e. I/O). - 52What happens to a thread when a process is suspended / terminated?The threads are also suspended / terminated.
- 53What is meant by user-level threads?

- 54What is one of the issues with user-level threads?If one thread blocks for some reason, all the others cannot continue and that is because the kernel cannot interleave their execution on the OS level, because user-threads are invisible to the kernel.
- 55User-level threads #2

- 56Kernel threads.

- 57What are the two main advantages of kernel-level threads?1) When the kernel is scheduling threads, when one is blocking others can still run.
2) Threads of the same process can execute on different cores. - 58What are some of the disadvantages of kernel-level threads?More management effort, any thread switch requires mode switching. As a result they are much slower to create and terminate than user-level threads.
- 59Hybrid threading libraries (i.e. user-level threads that map to kernel-level threads).

- 60What is the N:1 multi-threading model?

- 61What is the 1:1 multi-threading model?

- 62What is the N:M multi-threading model?

- 63Why are thread pools needed?Thread pools are needed because there are a limited number of threads that can run at once. When all threads are in use, the thread pool queues up the job to be later processed when a thread becomes available. By doing so, the creation and termination of new threads is bypassed, therefore saving CPU time. This mechanism is typically used by servers.
- 64Thread pool.

- 65What are the advantages of thread pools?

- 66What does pthread_create() do?Creates a new thread.
- 67What does pthread_exit() do?Terminates the calling thread.
- 68What does pthread_join() do?Wait for a specific thread to exit.
- 69What does pthread_yield() do?Release the CPU to let another thread run.
- 70What is meant by the job and task terminology?

- 71What does multiprogramming and multiprocessing correspond to?Multiprogramming corresponds to concurrency.
Multiprocessing corresponds to parallelism. - 72What is one of the difficulties with parallelism?Because things run at the same time, then we can no longer rely on sequential execution which is where we need to have more effort to synchronize what is going on between different execution flows.
- 73What challenges must be considered when parallelizing applications?

- 74When do race conditions occur in regards to parallel processing?When two or more threads that access shared data and try to change it at the same time, and because the thread scheduling algorithm can swap between them you don't really know the order in which the threads will attempt to access that memory location.
- 75What is hyperthreading?Hyper-Threading Technology is a form of simultaneous multithreading technology introduced by Intel, while the concept behind the technology has been patented by Sun Microsystems. Architecturally, a processor with Hyper-Threading Technology consists of two logical processors per core, each of which has its own processor architectural state. Each logical processor can be individually halted, interrupted or directed to execute a specified thread, independently from the other logical processor sharing the same physical core.
- 76How much speed can be gained from parallelization?

- 77Example of threads in Java.

- 78What information is stored in a process's control block (PCB) ?1) Process state (i.e., running, blocked, etc)
2) Program counter.
3) CPU registers.
4) CPU scheduling information
5) Memory management information.
6) Accounting info (i.e., CPU time used, time limits, ...)
7) I/O status information. - 79In short what does a scheduler do?Selects processes from the ready queue.
- 80In terms of scheduling, what does the dispatcher do?Performs context switches.
- 81In terms of scheduling, what is the ISR?Interrupt Service Routine.
- 82When does scheduling take place?

- 83Are batch systems preemptive?No
- 84What is the formula for calculating CPU utilization?

- 85What are the main scheduling criteria?

- 86What is meant by CPU utilization?Percentage of time CPU is busy.
- 87What is meant by throughput?Processes handled per second.
- 88What is meant by turnaround time?Time from submission to completion.
- 89What is meant by waiting time?The time processes spend in the ready queue.
- 90What is meant by response time?Time from the submission of a process to the first response (interactive systems).
- 91What type of operating systems are designed to meet strict deadlines?Real-time systems.
- 92In regards to scheduling what is meant by the predictability criterion?Avoiding erratic behavior that needs frequent correction.
- 93In regards to scheduling what is meant by the fairness criterion?Every process gets a turn.
- 94In regards to scheduling what is meant by the balance criterion?All system components are well-used, not just the CPU.
- 95In regards to scheduling what is meant by policy enforcement?Some things are more important than others (e.g., make sure critical processes can run when needed).
- 96Name three scheduling algorithms you might find on batch systems.1) First-Come First-Served
2) Shortest Job First
3) Shortest Remaining Time Next - 97Name three scheduling algorithms you might find on Interactive systems.1) Round Robin
2) Priority Scheduling
3) Feedback Scheduling - 98Name two scheduling algorithms you might find on real-time systems.1) Earliest Deadline First
2) Rate Monotonic Scheduling - 99What is an example of a real-time system?A flight controller.
- 100What is the main advantage of shortest job first when compared to first-come first-served?The average waiting time per process is less.
- 101How can predictability be acheived when scheduling shortest jobs in shortest job first?

- 102How is turnaround time of a process computed?The time the process complete minus the arrival time.
- 103How is the waiting time of a process computed?Turnaround time minus burst time.
- 104What is meant by resource allocation?For example, when many programs are running simultaneously, the OS might need to allocate the CPU to one of them, and memory to some of them.
- 105What connects user threads with kernel threads?A lightweight process. When a kernel thread blocks, so does the lightweight process which in turn results in the user thread to also block.
- 106Give a basic explanation of the shortest remaining time first algorithm.Basically just a preemptive version of shortest job first.
- 107In round robin, what are the effects of an extremely large and extremely small time quantum?A time quantum that is too large will inevitably result in first-come first-served behavior.
A time quantum that is too small will lead to too much overhead as an unnecessary amount of context switches will occur. - 108What is the multilevel feedback queue scheduling algorithm?The multilevel feedback queue scheduling algorithm allows
a process to move between queues. The idea is to separate processes according
to the characteristics of their CPU bursts. If a process uses too much CPU time,
it will be moved to a lower-priority queue. This scheme leaves I/O-bound and
interactive processes in the higher-priority queues. In addition, a process that
waits too long in a lower-priority queue may be moved to a higher-priority
queue. This form of aging prevents starvation. - 109Why is it important to perform load balancing on symmetric multiprocessing systems?On SMP systems, it is important to keep the workload balanced among all
processors to fully utilize the benefits of having more than one processor.
Otherwise, one or more processors may sit idle while other processors have
high workloads, along with lists of processes awaiting the CPU.
Load balancing attempts to keep the workload evenly distributed across all processors in an SMP system. - 110What are multithreaded processor cores?Multithreaded processor cores have two (or more) hardware threads assigned to each core. That way, if one thread stalls while waiting for memory, the core can switch to another thread.
- 111What is meant by long, medium and short-term scheduling?The long-term scheduler, or job scheduler, selects processes from this pool and loads them into memory for execution.
The short-term scheduler, or CPU scheduler, selects from among the processes that are ready to execute and allocates the CPU to one of them.
The medium-term scheduler essentially performs swapping (from main memory to secondary memory). - 112Describe the selection function, decision mode, overhead, fairness, starvation, throughput and waiting time of FCFS, SJF, SRT, and RR.

- 113What is generally considered a good time quantum for RR?80% of CPU bursts <= time quantum.
- 114What is the difference between multi-level scheduling queues and multi-level feedback scheduling queues?Multi-level feedback scheduling queues dynamically adapt to process behaviour (i.e., double time quantum when a process uses its full time slice and put it in a queue of lower priority).
- 115Explain the earliest deadline first algorithm (typically implemented in real time systems).

- 116Under which conditions can a set of periodic processes be scheduled to not miss their deadlines?When the time to execute divided by the available time is <= 1
- 117What is a race condition?A situation where several processes access and manipulate the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place.
- 118How can race conditions be prevented?With the synchronization of processes which share some common data running in parallel.
- 119What is a critical section and what does it imply?Consider a system consisting of n processes {Po, P1 , ... , P11 _ I}. Each process has a segment of code, called critical section in which the process may be changing common variables, updating a table, writing a file, and so on. The important feature of the system is that, when one process is executing in its critical section, no other process is to be allowed to execute in its critical section. Each process must request permission to enter its critical section.
- 120Critical section code.

- 121What are the three requirements for the solution to the critical section problem?

- 122What is mutex short for?Mutual exclusion.
- 123Which four conditions must hold in order for a deadlock to potentially occur?Mutual exclusion.
Hold and wait.
No preemption.
Circular wait. - 124How does deadlock prevention work?Deadlock prevention provides a set of methods for ensuring that at least one of the necessary four conditions cannot hold. These methods prevent deadlocks by constraining how requests for resources can be made
- 125How does deadlock avoidance work?

- 126Describe two protocols that can be used to break the hold and wait criterion in order to prevent deadlocks.

- 127What is the difference between deadlock avoidance and prevention?Prevention is when at least one of the four conditions of a deadlock do no exist in the system.
With avoidance, processes must first inform the system of all the resources needed prior to executing. This way the system can determine when it is safe to execute. - 128What could be an indicator that a deadlock has occurred?Blocked queue increasing and CPU utilisation lowering
- 129What is the MMU?Memory Management Unit.
- 130What does the MMU do?Maps virtual addresses of a program to physical addresses at run time.
- 131What does paging solve?Paging avoids external fragmentation
and the need for compaction. - 132When does address binding occur?

- 133What is in the process image?

Información
- Descripción
- Fichas sobre Operating Systems, creado por Zenos Pavlakou el 05/06/2018.
- Creado por
- Zenos Pavlakou
- Visitas
- 2
- Etiquetas
- Valoración