Operating Systems II Flashcards
What do you have to do to run powershell commands? What is their file extensions?
- run as admin
- .ps1
Which commands do not carry over from bash?
- chmod
- wc
- < but >»_space; are allowed
- grep is instead called sls
- case is instead called switch
What is the measure-object command?
- allows us to retrieve information of passed in values
- such as count, sum, min and max
What is the sign for variables in PS?
$
What is the correct formation for functions and conditional structures?
- Functions must be defined with “Function” before the name
- round brackets are used for conditionals
How can process be created? What is it called?
- can be created by a user or by another process (parent and child processes)
- spawning is act of creating a new process
What happens in process creating in UNIX?
- first process created at start up is responsible for scheduling (called sched) and has PID = 0
- creates another process (called init) which is origin of all child processes PID=1
What is fork and what is exec?
- two system calls used to create process in a programme
- Fork = creates an exact copy (child) of the current process in a separate memory space
- exec = called by the child, loads a new program in the memory space (replace)
What is a thread?
- unit smaller than a process, can be scheduled and executed
- can have single threaded (common) and multi-threaded processes (maximises eff)
What is context change?
- during switch from process 1 to process 2 the OS stores the current state of p1 and the last state of p2
- time consuming
What is the definition of scheduling?
-trying to find the most efficient assignment of processes to the CPU
What are the 3 types of scheduling?
- high level scheduling HLS = whether to admit process or not
- MLS = temporarily remove or reintroduce a new process
- LLS = decides which ready process must be assigned to CPU
What are the 5 different states?
- Running - process assigned to CPU
- blocked - process is waiting for I/O
- ready - process is waiting to be assigned to CPU, cpu busy
- suspend and resume - suspended process remain in sleep mode until resumed
- processes can be suspended at the blocked, ready and running stage and will enter either blocked suspended or ready suspended
What is pre-emptive scheduling policy?
-remove a process from running state
What are non-pre-emptive scheduling processes
-processes run until they perform an I/O operation (blocked) or simply terminate
What is FCFS?
- Non-pre-emptive
- ready process is dispatched when the running process releases CPU
- run to completion
- average waiting time depends on order in which processes are fed into it
- simple and fast, bad for short and I/O processes
What is shortest job first?
- completes shortest job start to finish
- non-pre-emptive
- calculates shortest estimated run time
- next process is the one in the ready queue with the shortest estimated time
- some longer processes may never be seen (starvation)
What is shortest remaining time?
- pre-emptive
- process with shortest time runs unless a new process comes with a shorter time, in which case that new process is executed
- better for short processes, starvation
What is highest response ratio next?
- non-pre-emptive
- both waiting time and run time considered
- one way to work out priority is; p = (wait time +run time)/run time
- wait time set to 0 for every process and beginning so each one has priority 1
- if wait time increases so does priority
- no starvation, more complicated
What is round-Robbin?
- pre-emptive
- processes are all given equal amount of time in CPU (time quantum)
- time quantum should not be too short
- if process does not finish it is sent to back of queue
- simple with no starvation, frequent context changes
What are MLFQ’s?
- pre emptive that combines many techniques
- different priority level FIFO queues
- enter first priority level, executed for time quantum, sent to second priority queue if not finished, executed for time quantum etc unless another process enters a higher P queue in which case that will be executed until it catches up with first process or it completes
- favours short and new processes, starvation (solved by varying time quantum and priority)
What are concurrent programming applications?
-set of cooperating processes dealing with asynchronous events