multi-process systems Flashcards
what are the 3 types of multi-process systems
batch
real time
interactive
what are real time systems and what are the 2 types
time critical elements to operation of processes
soft and hard
how do batch systems work
they run a job periodically e.g. a payroll
how are batch systems non pre-emptive
it allows a job to fully complete before starting another one
what is the role of scheduling policies
decide which job to run next
how does the shortest job scheduling policy give higher throughput
as you are quickly able to submit more jobs
negative of shortest job first
unfair on longer jobs
negatives of longest job first
starves the shorter jobs of processing time
if the job isnt critical then the user may think that the system is unresponsive
what are the 2 types of processes and explain them
cpu bound: spend most of the time processing data e.g. doing calculations
i/o bound: spends most time waiting for data
what is a negative of cpu bound processes
they usually run for a longer time before releasing control which prevents other processes from getting access to the processor
what is a positive of io bound processes
v frequently give up control and are usually blocked whilst waiting on a device
what is scheduling overhead
the cost of every process switch: time to handle the interrupt, save the current process , select the next process and recover its process control block
negative of io bound processes
can have lots of scheduling overhead if switching often
what are the two types of interactive systems
cooperative multitasking system
pre-emptive multitasking system
cooperative multitasking system
yield operations that are inserted every few lines in the code invoke the scheduler giving the system a choice to move to another operation
pre-emptive multitasking system
scheduler forcibly takes control at regular intervals
cooperative multitasking system positive
stops the cpu processes from blocking others for too long
priority scheduling
each process has a priority with separate queues for each priority (usually round robin)
what is priority inversion and in what case would we use it
inverting the priority of processes so that low priority get a burst of cpu time ( this happens at intervals)
a high priority process needs a recourse held by a low priority in a critical selection they both cant run as the hp needs the recourse and the lp is being blocked by the hp
what are deferred procedure calls
the isr does the essential work and the rest of the work is deferred to another process
this still runs but just later
what kind of privileges does a deferred system have
the least in the system
why do we use deferred procedure calls
due to a large number of interrupts per second and failure to complete them can cause system failure
but dont want to spend all the process time doing interrupts
what are the three types of schedulers
long term
medium term/high level
short term/low level
long term scheduler
decides whether a job should be allowed on the system
e.g. are there enough resources on the system for it
medium term/high level scheduler
which set of jobs should be in memory at any given time
which process should run on which processor
short term/low level scheduler
called at every time slice and decides which process should run next
dispatcher
the code that actually switches the process control blocks
what are the 5 things we look for in scheduling criteias
cpu utilisation
throughput
turnaround time
waiting time
response time
cpu utilisation
the % of time the cpu is running app code
throughput
how many jobs are being complete in a certain time
turnaround time
how long it takes a job to complete after submission
waiting time
how long a job is in the ready queue
response time
the time between starting a job and when it begins to do something useful
how do we calculate the waiting time
dispatch time - arrival time
avg = total dispatch time / number of processes
how do we calculate the turnaround time
completion time - arrival time
how is round robin scheduling pre-emptive
the scheduler forces a context switch at defined intervals
scheduling quantum
the time each process is allowed to run in round robin
how do we calculate the avg wait time in round robin
must account for each time its back in the ready queue as its places back there when the quantum runs out
how does round robin scheduling work
once we get an interrupt we add it to the scheduling function
we loop through processes in order and when one is de-scheduled at the end of the time slice then we place the process at the back of the queue
what is the role of scheduling function
decides which process should run next
what happens when we have a long scheduling quantum
the system will seem less interactive as there will be fewer context switched
however this is more efficient
what happens when we have a short scheduling quantum
more interactive but more switches makes it less efficient as there will be more scheduling overhead