Programs, Processes, Processors and OS Flashcards
Processor
hardware device that executes instructions
Program
instruction sequence defining potential execution path; passive description; stored on disk/secondary memory
Process
active system entity executing associate program; program in execution on proccessor; resides in main memory
Context Switch
execution jumps to another part of memory
A thread’s context consists of (at its minimum)
- Program Counter
2. Stack Pointer
Context-Switching Sequence
- De-schedule currently running thread(save pc and sp registers of current thread)
- scheduler selects ‘best’ ready thread to run next
- resume newly-selected thread
Program counter
points at instruction to be executed next in memory
Stack Pointer
Address at the top of the thread’s call stack.
Parallelism
Multiple processes executing simultaneously, all executing at a given instant.
Concurrency
Multiple processes but less than all of them (
“Safe” concurrency
- No shared resources
2. No modification of data (read-only data)
Limit to Performance: Amdahl’s Law
“Program speedup by adding more processors is limited by the serial part of the program”;
Theoretical maximum speedup is x20
Unix-Style Processes
unix processes combine a thread of execution with a ‘private virtual address space’
Threads
the lightweight locus of computing abstraction; share a common address space
User Threads
cheap context switch; no OS support required kernel only knows about processes; user-level scheduler; user threads in the same process can't execute on separate CPUs - OS is not aware of them
Kernel Threads
supported by OS; scheduled by OS Scheduler; threads are preemptable by the OS