resource management at system and network level Flashcards
operating system
core software device that manages recourses and serves as an interface between hardware and user applications
what are the core functions of the os
process management
memory management
i/o management
file system management
process management
handling the lifecycle of processes
memory management
allocation and managing system memory
i/o management
managing data input and output from hardware
file system management
managing the file storage and retrieval
kernel
core compound of an os
monolithic kernel
apps cannot directly interact with certain parts of the system but have to do it through an interface; system calls
what are monolithic kernels usually used in
general purpose applications
what are micro kernels usually used in
embedded systems; lightweight and recourse constrained
microkernels
the kernel is used for scheduling whilst other capabilities are controlled by servers
how do monolithic and micro kernels differ in size
mono; large and complex
micro; small and minimal, only basic services
how do monolithic and micro kernels differ in modularity
mono; less modular, new features will affect the entire system
micro; more modular, easy to scale and can bring in new services without changing the entire os
how do monolithic and micro kernels differ in security
mono; if the kernel is compromised the entire system is down
micro; more secure as everything is isolated from each other so attacks will only affect the section attacked
how does security work in microkernels
you can change security measures for each server based on its needs
what is a negative of microkernels (performance)
you cant run applications concurrently as they’re all communicating with each other which reduces performance
process abstraction
the os abstracts running programs as processesr
recourse contention
multiple processes compete for cpu time, memory and i/o
how does the kernel view processes
the kernel keeps a data structure for each process; process control block
pcb
process control block
what are the 7 parts of the pcb
process state
process id
user id etc
program counter
registers
address space
open files
what is the role of registers in the pcb
store information about the process running
what are the 4 process states
new
ready/runnable
running
waiting
waiting (process state)
the process is waiting for an event to be completed e.g. system call and when this is completed it goes back to the ready state and the os decides when it should be run
what is the benefit of the waiting process state
i/o processes are quite slow so it is more efficient to have another process running whilst you wait
what is process scheduling
how the os decides which process gets cpu time
pre-emptive scheduling
the os interrupts a running process to switch to another one
fork (pre-emptive scheduling)
when the process currently running requires another process to begin in order to complete it
periodic timer interrupt (pre-emptive scheduling)
if the running process used up the time given another is scheduled
non-pre-emptive scheduling
the process is allowed to finish before switching
context switching
moving from one running process to another
device interrupt (pre-emptive scheduling)
when a disk request is complete or a packet is received the process that was waiting for it is moved form waiting to ready and the os decides if it should run or continue waiting based on priority
what is a negative of context switching
uses a lot of recourses as you have to save the pcb then load it again in the execution state
what is multitasking and what are some benefits
the os executing multiple tasks simultaneously which improves cpu efficiency and user experience
pre-emptive multitasking
the os allocated cpu time in time slices and interrupts tasks when needed
cooperative multitasking
processes give up cpu time to allow other tasks to run
what are some positives of multitasking
allows for efficient recourse use
better user experience
multitasking negatives
context switching overhead
synchronization issues
threads
a schedulable unit of execution within a process that shares resources with other threads in the same process but executes independently, making it lightweight
what is a benefit of threads
can reduce context overhead
multi-threading
spawning multiple threads of execution that run concurrently
benefits of multi-threading
allows 1 process to use multiple cpus and cores
allows programs to overlalp i/o and computation
kernel level threads
each user level thread is mapped to a kernel level thread
allows parallelism
user lever threads
multiple user level threads are mapped to one kernel level thread
no parallelism
benefit of user level threads
reduces context switching overhead
what causes contention
high network traffic
limited available bandwidth
congested network paths
what is contention
when multiple processes, devices and users compete for limited network bandwidth
what is the difference between circuit and packet switching
packet; small packages on different paths
circuit; one dedicated path is established between the two nodes
positive of packet switching
efficient bandwidth use
better for bursty traffic
negative of packet switching
variable latency
possible packet loss
circuit switching positive
guaranteed bandwidth
low latency
circuit switching negative
inefficient use of recourses during idle periods