1/48
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Operating Systems
A program that manages hardware and provides other programs with an environment to run in
Process
program in execution
OS Kernel
Central component of O.S that performs the most important OS tasks
system call
request for service from an application to the operating system
multitasking
technique to fake simuntaneous processes on a single CPU core
virtual memory
technique to fake larger RAM memoy with hard disk
Interrupt
a signal about important event that requires immediate attention
Drivers
small program that handles communication between operating system and devices
files
related data stored in hardisk on one name
file system
collection of data about all files on the computer, including physical coordinates of files on hardisk
operating system api
set of tools the O.S providers for programmers to use, making it convienent, Extra level of abstraction
Logical Disk Partition
portion of hardisk described in a seperate file system
Networking Adaptor
A piece of hardware that recieves and sends data physically through the network
Protocol
bunch of rules on how to send/recieve and understand data
Process Control Block (PCB)
record for a single process maintained by the operating system
PID
Process Identification Number, all unique
context switch
sequence of steps that CPU goes through to switch execution from one process to another
Heap
process that does dynamic memory allocation
Stack
All data belonging to function
Process States
New State: process created, not ready to do anything
Ready Queue: collection of processes ready and willing to use CPU
Running: Process is using CPU
Waiting: I/O queue, collection of processes to use corresponding I/O device, does not wait to use CPU
Terminated: PCB remains, process terminated
POSIX
set of standards that define how Unix-like operating systems should behave to maintain compatibility across systems.
FORK
command allows us to utilize more than one core on computer
EXEC(“executable_name”)
erases all process content and loads instruction and data from executable file mentioned in parameter
exit(0)
Way to exit, the number inside is a status code
wait()
pause the process until it’s child terminates
zombie process
process that call exit but whos parent hasn’t called wait yet
orphan process
process when parent has exited
IPC (Inter-Process Communication)
Tools for allowing programs to talk to each other:
Message Passing, Shared Memory
Message Passing
OS sends the message each time to ask the O.S you need a system call
- slower
+ easier to program correctly
+ can be used by processes on different computers (networking)
Shared Memory
O.S establishes shared memory (shared RAM) between different processes and can read/write and vice versa. Only need one system call
Web Server
program that manages web pages, manages request from browsers
DNS server
gets URL and returns corresponding IP address
Networking Ports
unique numeric identifiers given to any process that wants to use the network
Well known networking ports
networking ports reserved for specific purpose, predetermined purpose
networking socket
combo of IP addresses and networking ports
Thread (thread of execution)
independent execution of program code from a seperate program counter
Ready Queue
collection of processes ready and willing to use CPU
What do threads share?
Text section (program code)
Data section (global & static variables)
Heap (dynamically allocated memory, e.g. malloc, new)
What don’t threads share?
Stack
Stack pointer / registers
Local variables (function calls, etc.)
Thread vs Processes
Threads are:
Fast to create and delete
Memory efficient (copy nothing, created inside process)
Context switching is faster
Shared memory by default
Processes are:
Can run exec()
Fault-independent
Fault independence
One process doing something bad doesn’t mean other processes are bad
Kernel Thread
threads managed with O.S helps, the O.S knows about that and can manage them seperatly and efficiently.
User Threads
Threads managed without the help of O.S → fast to manage, cannot use multiple cores, one thread books all (faster than kernel threads)
Hardware Threads
Amount of threads your CPU run simultaneously
Thread Local storage
A tool that allows you to create a variable that is global but still private for each thread
Thread pool
Maximum number of threads created then put to sleep, when a user request arrives you wake up one of the created threads, once finished using you freeze it and return it to thread pool.
Context Switch
A sequence of steps to change CPU from running one process to running another process.
Pause process 1
Save all general purpose CPU register and PC of P1 (saving context)
Load all general purpose CPU register and PC of P2 (loading next)
Resume Process 2 (Slow because it accesses information from RAM memory)