Operating Systems Flashcards
1
Q
cpu/microprocessor
A
- central processing unit
- cpu carries out all instructions of a computer program
- microprocessor is a one chip implementation of a CPU
2
Q
kernel
A
- computer program at core of an operating system
- first program that runs upon boot-up
- lowest layer above CPU
- manages a variety of basic, low-level jobs
- manages CPU resources, memory and processes
- handles networking (wifi, bluetooth, etc.)
- file system
- every multitasking operating system uses a kernel
3
Q
memory controller
A
- interface between CPU and RAM
4
Q
RAM
A
- volatile memory, disappears when computer is shut off
- working memory, contsins memory needed to complete task at hand
5
Q
ROM
A
- read only memory
- data is hard-wired, so it can only be modified with difficulty, or not at all
- usually used to store firmware (software associated with hardware)
Ex:
- CD-ROM
- Gameboy game cartdridge
6
Q
machine code
A
- language used by a computer’s CPU (0s and 1s)
- sometimes converted into a more human-readable version called an ‘assembly language’
- consists of words like load, movl, push
- Examples
- IA-32
- x86-64
- ARM
- MIPS
7
Q
program
A
- static copy of a application loaded into memory when launch that application
8
Q
process
A
- An instance of a program in execution
- program + state (which evolves as program executes)
9
Q
thread
A
- a line of execution within a process
10
Q
locking
A
- when a thread encounters a part of a program where ia shared resource is located (a critical section), it locks access to that data temporarily
- prevents multiple threads from writing in the same place at the same time
11
Q
mutual exclusion
A
- the contraint that access to critical sections should be prohibited when being modified by one thread
12
Q
deadlock
A
- situation in which 2+ threads/processes are awaiting access to a critical section that is being locked by one of those threads
2 solutions
- Detection and recovery
- Break the deadlock by terminating a thread
- Usually not practical in operating systems
- Prevention
- Force each thread to request resources in the same order
- Force each thread to request resource at the sametime
13
Q
livelock
A
- similar to deadlock, except that the states of processes involved keeps changing (with respect to each other)
- usually refers to when a deadlock continually recurs after the processes are reset
- best solution is to ensure that only one process resets at a time
14
Q
concurrency
A
- ability to handle multiple jobs at once, usually by doing bits and pirces of each
- similar to multi-tasking by humans
15
Q
parallelism
A
- executing 2+ tasks at the same time
- requires multiple cores
16
Q
atomicity
A
- the requirement that the procudure you’re performing is all or none
- Ex: you can’t half-way change an array
17
Q
context switch
A
- mechanism used by operating systems to switch from one process to another process
- they are expensive
- direct costs: costs of clearing and loading instructions into memory
- indirect costs: cache misses (data was removed from cache during context switch)
18
Q
producer consumer problem
A
- a conceptual problem that consists of two tasks (producer/consumer) and a buffer
- producer adds data to buffer, consumer uses data
- problem is to make sure that producer doesn’t add to full buffer, and consumer does take from empty buffer
- can solve with 2 sempahore
- One semaphore represents resources that producer creates and consumer wants (init to 0)
- Another represents space in buffer (init to buffer.length)
19
Q
semaphore
A
- abstract data type
- construct used for synchronization
- essentially an integer counter with special addition operations
- a semaphore initialized to K enforces the following constraint:
- sigi <= waiti+k
- ith signal happens before i+kth wait
3 operations
- init
- initialize counter value to K
- K is often the size of the resource
- signal
- increment counter
- as a side effect, potentially wake a process
- wait
- decrement counter
- if counter is zero, then block until semaphore is signaled (counter is incremented) and then decrement
20
Q
mutex
A
- a flag used to implement mutual exclusion
- usually implemented as a simple semaphore
Steps
- Initialize semaphore to 1
- Wait when process begins (decrement to 0)
- Signal when process ends (increment)