Title: CSE 351 23au / LS23 Processes I

Q: What term do we use to describe the order of execution of individual statements within a single program?
A: control flow

Q: Knowing that are computers actually execute multiple programs at the same time, what do we call the mechanism that allows us to transfer control between processes and the operating system?
A: exceptional control flow

Q: In response to some event, the part of the operating system that an exception transfers control to is known as the ___
A: kernel

Q: What are the three possible outcomes upon the completion of the event handler?
A: Rexecute the instruction that caused the original event - the event has been handled, but the original instruction did not complete as intended
Execute the next instruction - the event has been handled and the original instruction completed as intended
Abort the process - the event could not be handled so the only choice is to exit

Q: Asynchronous exceptions (also known as interrupts) are caused by events that are ___ (internal/external) to the processor.
A: external

Q: True or False: An example of an asynchronous exception could be when a user clicks a mouse button
A: True, the clicking of a mouse button physically triggers the hardware around the CPU to indicate that it needs to do something

Q: Synchronous exceptions are caused by events that are ___ (internal/external) to the processor.
A: internal

Q: Name one example of a synchronous exception
A: Traps: are caused by instructions that intentionally transfer control to the operating system to perform the desired function with a privileged resourced like disk or network.
Faults: are unintentional and handle unexpected outcomes from regular instructions.
Aborts: are very uncommon and are unintentional and unrecoverable.

Q: The abstraction that each process believes that it has exclusive access of the CPU for executing its instructions, accomplished via context switching, is known as ___
A: logical control flow

Q: True or false: The private address space abstraction is that a process believes it only can use a portion of memory.
A: False, the private address space abstraction says that each process believes it has exclusive use of memory (where virtual memory becomes important)

Q: Context switching is managed by ___ and ___
A: operating system and exceptional control flow

Q: Order the following steps in a context switch
- Load saved registers and switch address space
- Save current registers in memory
- Schedule next process for execution
A: 1. Save current registers in memory
2. Schedule next process for execution
3. Load saved registers and switch address space