• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/33

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

33 Cards in this Set

  • Front
  • Back
  • 3rd side (hint)

OS

Layer of software that provides applications programs with a cleaner model of the computer (hardware)

First OS

Invented in 1950s

OS in the 70s

Unix and Apple dos

First Gen OS

Vacuum tubes, programs hard wired or on punch cards, no OS

Transistors and batch systems

Queue multiple jobs to execute, normally Fortran & COBOL on punch cards

ICs and multiprogramming

Multiple jobs in each memory partition, CPU executes other jobs while waiting. No more tapes, it reads jobs from cards to disk.

CPU cycle

Fetch, decode, execute

CPU caching

Goal is to increase performance by copying information from slow storage to fast storage

Trap

Instruction that switches from user mode to kernel mode and invoking a predefined function

Interrupts

Device driver to controller to CPU, handles interrupt, then resumes

Direct memory access

Device controller transfers bulk data to main memory without CPU

Kernel mode

CPU is unrestricted, all instructions, memory i/o is allowed

How does the kernel do I/O?

When the i/o finishes an operation, generate an interrupt, letting the os know if it's done or an error occurs

Monolithic kernel

Entire os runs as a single program in kernel mode

Faster but really hard to debug

Microkernels

Only essential components in kernel, rest is implemented as system programs in user mode

Modular kernel

Smaller kernel with modules, only loaded on demand

Context switching

Saving a state of a process and then later restoring that state to give the illusion of multitasking. Normally when processes exceeds time slice

Asynchronous thread cancellation

One thread manually terminates the target thread, but it can leave data in an undefined state

Deferred thread cancellation

Controlling thread indicates the thread it wishes to cancel and uses flags to check for safe termination.

Reentrant function

Functions that can be interrupted in the middle of an operation and then called again, finally the original function can finish executing

Race condition

Output is dependent on the sequence or timing of other uncontrollable events such as context switching or scheduling

Often a result of multiple processes or threads operating on a shared resource

Requirements to avoid race conditions

No 2 processes may be simultaneously inside their critical sections.


No assumptions be made about the speed or number of CPUs.


No process running outside its critical region may block other processes.


No process should have to wait forever to enter its critical section.

Deadlock

Nothing useful happens

Livelock

Form of starvation, something is happening but nothing useful

Arbitrator solution

Parallelism, in which there is non-optimal use of resources

Random timeout problem?

Prevents deadlocks but has a fairness problem

Resource hierarchy

Partial order on resources, starvation is still possible and not practical for large numbers of resources

Semaphore

Special integer variable used for signalling among processes. Can be locked by a thread and unlocked by any thread.

Condition variable

Useful for implementing CS containing loops waiting for conditions. Can block threads while other threads does something to satisfy that condition

Bash script

find . - type f - name "$1" - printf '%p%s\n' |sort - k 2 - n - t '' - r |head - 2 |awk '{x += $2; print $2} END


Print all lines in txt that are longer than 80 characters

Cat file.txt |awk 'length($0) > 80'

Predicted burst equation

P = a * b + (1-a) * p'

Deadlock conditions

Mutual exclusion - resources are unshareable


Hold and wait - a process holding at least one resource is waiting to acquire additional resource


No preemption - a resource can only be released by the process holding it


Circular wait - Cycle of processes