Week 10 AOS: Interprocess Communication and Process Scheduling (Content)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/35

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

36 Terms

1
New cards

What is IPC?

Mechanism for processes to share information without direct memory access. (Processes are isolated.)

2
New cards

Two main IPC issues

Avoid race conditions; ensure correct sequencing. (Safety + ordering.)

3
New cards

Definition of race condition

Outcome depends on unpredictable timing of processes. (Shared data conflict.)

4
New cards

Definition of critical region

Section of code accessing shared data. (Needs protection.)

5
New cards

Definition of mutual exclusion

Only one process may enter critical region at a time. (Prevents races.)

6
New cards

Four requirements for solving critical section problem

Mutual exclusion; no assumptions about speed/CPUs; progress; bounded waiting. (Correctness conditions.)

7
New cards

Busy waiting

Process repeatedly checks a condition while consuming CPU. (Inefficient.)

8
New cards

Lock variable idea

Shared lock=0 means free; lock=1 means busy. (Fails due to race on lock.)

9
New cards

Strict alternation

Processes alternate turns entering critical region. (Mutual exclusion but violates progress.)

10
New cards

Peterson’s solution

Uses flag[i] and turn to ensure mutual exclusion + progress. (Classic software solution.)

11
New cards

TSL instruction

Atomic test-and-set hardware instruction for locking. (Prevents races.)

12
New cards

XCHG instruction

Atomic swap used for locking on x86. (Hardware mutual exclusion.)

13
New cards

Problems with busy waiting

Wastes CPU; priority inversion. (Inefficient + unfair.)

14
New cards

Priority inversion

Low-priority task blocks high-priority task by holding resource. (Inversion of priorities.)

15
New cards

Sleep and wakeup

Sleep blocks a process; wakeup unblocks it. (Avoids busy waiting.)

16
New cards

Producer-consumer problem

Producer fills buffer; consumer empties it. (Needs synchronization.)

17
New cards

Semaphore definition

Integer with atomic up/down operations. (Synchronization primitive.)

18
New cards

Semaphore operations

down() waits/decrements; up() increments/wakes. (Atomic.)

19
New cards

Semaphores in producer-consumer

full, empty, mutex. (Synchronization + mutual exclusion.)

20
New cards

Mutex definition

Binary lock for mutual exclusion. (Protects shared resources.)

21
New cards

Mutex vs semaphore

Mutex = lock; semaphore = counter. (Different semantics.)

22
New cards

Monitors

Language-level construct with implicit locking + condition variables. (Safer abstraction.)

23
New cards

Message passing

send/receive communication without shared memory. (Distributed-friendly.)

24
New cards

Deadlock definition

Processes wait forever for each other. (Circular wait.)

25
New cards

Livelock definition

Processes keep reacting without progress. (Active but stuck.)

26
New cards

Starvation definition

Process never gets CPU time. (Unfair scheduling.)

27
New cards

CPU-bound vs I/O-bound

CPU-bound = long bursts; I/O-bound = short bursts. (Scheduler behaviour.)

28
New cards

Cooperative vs preemptive scheduling

Cooperative = voluntary yield; preemptive = forced context switch. (Scheduling style.)

29
New cards

Batch vs interactive vs real-time scheduling

Batch = throughput; interactive = responsiveness; real-time = deadlines. (Different goals.)

30
New cards

Scheduling goals

Fairness, policy enforcement, balance. (General.)

31
New cards

CPU scheduling criteria

Utilization, throughput, turnaround, waiting, response time. (Metrics.)

32
New cards

FCFS

Non-preemptive, simple, long waiting times possible. (Queue order.)

33
New cards

SJF

Shortest job first; optimal average waiting time. (Non-preemptive.)

34
New cards

Round robin

Fixed quantum; preemptive; good responsiveness. (Interactive systems.)

35
New cards

Quantum size trade-off

Too small = overhead; too large = poor response. (Balance needed.)

36
New cards

Priority scheduling

CPU given to highest priority (lowest number). (Can cause starvation.)