Operating Systems Flashcards
What is a process tree?
Processors can create other processes.
- The creator is the parent process
- The created is the child process
What is a process?
A process is an instance of a program that is being executed (loaded into memory and is running)
Includes:
- The current values of the program counter, registers and variable.
- Its instruction code and current data inputs.
What is a thread? and what does it do?
A thread is a mini-process; it is a process within a process
It can be created an destroyed easily
Example: Word processor
What are sync problems?
When we allow multiple processes to share resources and communicate, problems arise
Deadlocks - a situation where two or more processors are each waiting for resources held by others
Starvation - a process never gets access to a required resource
Race Conditions - two or more processors competing for a share resource
- the result varies according to the order of process execution
What is the scheduling concept?
The O.S needs to make a choice
- There are different factors that affect the choice
- There are different algorithms to make the selection
What is context switch?
When the processor switches to another process, the system must save the state of the old process and load the saved state for the new process.
- The time spent doing this is overhead
- The system does no useful work while switching
What is a scheduling class?
Non preemptive: a running process may only move to the blocked state by choosing to do so itself
Preemptive: a running process may move itself to the blocked state or may be moved there automatically by the operating system as a result of a clock interrupt
Performance Measures:
Average response time: an average of the time taken for all the processes in an example process queue to start
Average turnaround time: an average of the time taken for all the processes in an example process queue to finish
First come first served
The process scheduler starts the processes in the order that they entered the queue - the first process to enter the queue is run first: it continues to run until it has finished
- the next process is run until it finishes
Once a process starts it does not get interrupted by the operating systems and continues until it finishes
What is ‘Shortest Job First’?
The processes are started in order of length, starting with the shortest
It’s nonpreemptive
What is ‘Round Robin’?
Go in order - abcabcabcabababaaaaa
Until run out of quanta
What is a ‘Modified Round Robin’?
Same as round robin except if its has a number you do the number of each process.
A+2
E.g usually abcabcabc
MRR: aabcaabc
Priority Queues
Ran in priority order e.g. A = 1 B = 2 C= 3
Abc