Operating Systems Flashcards Preview

General > Operating Systems > Flashcards

Flashcards in Operating Systems Deck (20):
1

cpu/microprocessor

  • central processing unit
  • cpu carries out all instructions of a computer program
  • microprocessor is a one chip implementation of a CPU

2

kernel

  • 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

memory controller

  • interface between CPU and RAM

4

RAM

  • volatile memory, disappears when computer is shut off
  • working memory, contsins memory needed to complete task at hand

5

ROM

  • 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

machine code

  • 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

program

  • static copy of a application loaded into memory when launch that application

8

process

  • An instance of a program in execution
  • program + state (which evolves as program executes)

9

thread

  • a line of execution within a process

10

locking

  • 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

mutual exclusion

  • the contraint that access to critical sections should be prohibited when being modified by one thread

12

deadlock

  • situation in which 2+ threads/processes are awaiting access to a critical section that is being locked by one of those threads

2 solutions

  1. Detection and recovery
    • Break the deadlock by terminating a thread
    • Usually not practical in operating systems
  2. Prevention
    • Force each thread to request resources in the same order
    • Force each thread to request resource at the sametime

13

livelock

  • 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

concurrency

  • ability to handle multiple jobs at once, usually by doing bits and pirces of each
  • similar to multi-tasking by humans

15

parallelism

  • executing 2+ tasks at the same time
  • requires multiple cores

16

atomicity

  • the requirement that the procudure you're performing is all or none
  • Ex: you can't half-way change an array

17

context switch

  • 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

producer consumer problem

  • 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

semaphore

  • 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

  1. init
    • initialize counter value to K
    • K is often the size of the resource
  2. signal
    • increment counter
    • as a side effect, potentially wake a process
  3. wait
    • decrement counter
    • if counter is zero, then block until semaphore is signaled (counter is incremented) and then decrement

20

mutex

  • a flag used to implement mutual exclusion
  • usually implemented as a simple semaphore

Steps

  1. Initialize semaphore to 1
  2. Wait when process begins (decrement to 0)
  3. Signal when process ends (increment)