Processes Flashcards
What is a process?
A program in execution.
Can multiple processes run the same program?
Yes, ex: multiple users running bash
Which process have parent processes?
All except the first process
How to list processes?
◼ ps - List processes of the current shell session
◼ ps –u <your-login> - List processes owned by you
◼ ps –e - List all processes of the system</your-login>
What are the different states of a process?
New, Ready, Running, Waiting, Terminated
When is a process IO bound vs CPU bound?
IO bound, usually waiting for vent like mouse click. CPU bound waiting for cpu to finish their process, like video encoding.
What state are IO bound and CPU bound processes?
IO bound usually waiting state, CPU bound usually in ready or running state.
Are more applications usually IO or CPU bound?
IO bound
What is inside each entry of the process table?
PID: Index in process table
-Command and args
-Environment Vars
-Current Dir
-Owner (User ID)
-Stdin/Stdout/Stderr
-List of memory mappings used by
process
-List of Open Files
For each thread in the process:
- PC (Program Counter)
- Registers
- Stack
- State (Wait, Ready, Running
etc.)
What is the process scheduler?
the OS subsystem that ones run process after the other and decides what process to run next.
What is a context switch?
OS procedure to switch processes
What causes a context switch?
process yields cpu for another process, timer interrupt
What is non - preemptive scheduling (cooperative scheduling)?
Context switch only happens when process goes to waiting state.
What is preemptive scheduling?
Context switch caused by frequent timer interrupts.
What are the pros of both non preemptive, and preemptive scheduling?
Non is easier to implement, Preemptive prevents monopoly of CPU.
Preemptive is used today.
What is Round Robin?
All ready processes are put in and processed using a queue. Once timer expires, current process is moved to the back.
What is quantum length?
The set time before force switching processes.
What does a short length do?
Shortens average completion time, but increases amount of context switching time.
What is the quantum switch overhead?
Amount of time it takes to do a context switch as a portion of the quantum time.
Overhead% = Context switch time / quantum time
What is the standard quantum time today?
10ms
What is a CPU Burst?
The time a process needs the CPU. 90% of CPU bursts less than 10ms
How do more important processes get handled before less important ones?
With the Multilevel Feedback-Queue Scheduling
What is Process Aging?
The process of increasing a processes priority as it waits to be handled.