Core Concepts & Definitions
Interactive Flashcards
Card 1 of 12
Concurrency
The ability of an OS to execute multiple processes simultaneously, either through interleaving on a single CPU or in parallel on multiple CPUs.
Process Memory Layout
Stack
Local variables, function parameters
Heap
Dynamic memory allocation
Data Section
Global and static variables
Text Section
Program code (instructions)
Process Control Block (PCB)
- Process State
- Process ID (PID)
- Program Counter
- CPU Registers
- CPU Scheduling Info
- Memory Management Info
- I/O Status Info
Concurrency Challenges
Race Condition: count++ Example
Process 1
LOAD count (5)
INCREMENT (6)
STORE count
Process 2
LOAD count (5)
INCREMENT (6)
STORE count
Critical Section Problem Simulator
Process Configuration
Violations Detected:
Peterson's Algorithm Visualizer
Process P0
flag[0] = true
turn = 1
while(flag[1] && turn==1)
/* CRITICAL SECTION */
flag[0] = false
Process P1
flag[1] = true
turn = 0
while(flag[0] && turn==0)
/* CRITICAL SECTION */
flag[1] = false
Synchronization Algorithm Visualizer
Test-and-Set Lock Simulator
TestAndSet() Operation
boolean TestAndSet(boolean *target) {
boolean original = *target;
*target = true;
return original;
}
Lock: FREE
Performance Analysis
CPU Cycles Wasted (Spinning): 0
Context Switches: 0
Semaphore Operations Interactive Lab
Semaphore Configuration
Semaphore State
Value: 1
Waiting Queue
Process Operations
Operation Log
Classical Problems Interactive Lab
Producer-Consumer Problem
Bounded Buffer
mutex: 1
empty: 3
full: 0
Producer: Ready
Consumer: Ready
Dining Philosophers Problem
P0: THINKING
P1: THINKING
P2: THINKING
P3: THINKING
P4: THINKING
Deadlocks Detected: 0
Avg Eating Time: 0ms
AKTU Exam Prep Center
Inter-Process Communication Models
| Feature | Shared Memory | Message Passing |
|---|---|---|
| Speed | Very Fast | Slower |
| Kernel Involvement | Minimal | High |
| Synchronization | Manual | Built-in |
| Ease of Use | Complex | Simple |
Choose the Best IPC Model
Scenario: High-frequency data exchange between processes on the same machine
AKTU Question Generator
Your Progress
Semaphores
75%
Classical Problems
60%
Critical Section
85%