Docsity

Chapter_11_Operating_Systems_and_Concurrency, Lecture notes of Computer Fundamentals

Toggle sidebar
bg1
CH APTE R 11
Operating Systems & Concurrency
Applied Computing Study Notes • Resource Management, Processes & Scheduling
1. Core Role of an Operating System
An Operating System (OS) acts as the essential bridge between physical hardware and user software. Its primary job is to share
scarce hardware resources fairly, securely, and efficiently across competing programs.
Kernel Mode vs. User Mode: Hardware enforces dual-mode execution. User apps run in restricted User Mode and must request
privileged hardware actions via System Calls into the OS kernel.
Interrupt-Driven Design: Hardware timers and I/O devices raise interrupts to pause running code, letting the OS regain control
and respond immediately to events.
2. Processes, Threads & CPU Scheduling
A Process is an active program instance with its own isolated virtual memory space. A Thread is a lightweight execution path
inside a process that shares heap memory and open files with sibling threads.
Figure 11.1: Standard Process Lifecycle State Transitions
Scheduling
Policy How It Selects Tasks Primary Trade-off
Round Robin
(RR )
Gives each ready task an equal fixed time slice
(quantum) in a circular queue.
Great interactive responsiveness; high context-switch
overhead if quantum is too small.
Shortest Job
First
Runs the task with the smallest predicted CPU burst
next.
Minimizes average wait time, but long tasks risk starvation.
Priority
Preemptive
Immediately interrupts lower-priority work when a
critical task arrives.
Essential for real-time systems; requires priority aging to
prevent starvation.
3. Virtual Memory & Concurrency Hazards
Paging & Translation: Virtual addresses split into fixed-size pages mapped to physical RAM frames via page tables, allowing
programs to exceed physical RAM using disk swap space.
Race Conditions & Mutexes: When threads read/write shared state concurrently without coordination, results become
unpredictable. A Mutex (Mutual Exclusion Lock) ensures only one thread enters a critical section at a time.
•
•
NEW
READY
RUNNING
EXIT
WAITING (I/O)
•
•
pf2

Partial preview of the text

Download Chapter_11_Operating_Systems_and_Concurrency and more Lecture notes Computer Fundamentals in PDF only on Docsity!

CHAPTER 11

Operating Systems & Concurrency

Applied Computing Study Notes • Resource Management, Processes & Scheduling

1. Core Role of an Operating System

An Operating System (OS) acts as the essential bridge between physical hardware and user software. Its primary job is to share scarce hardware resources fairly, securely, and efficiently across competing programs.

Kernel Mode vs. User Mode: Hardware enforces dual-mode execution. User apps run in restricted User Mode and must request privileged hardware actions via System Calls into the OS kernel. Interrupt-Driven Design: Hardware timers and I/O devices raise interrupts to pause running code, letting the OS regain control and respond immediately to events.

2. Processes, Threads & CPU Scheduling

A Process is an active program instance with its own isolated virtual memory space. A Thread is a lightweight execution path inside a process that shares heap memory and open files with sibling threads.

Figure 11.1: Standard Process Lifecycle State Transitions

Scheduling Policy How It Selects Tasks^ Primary Trade-off Round Robin (RR )

Gives each ready task an equal fixed time slice (quantum) in a circular queue.

Great interactive responsiveness; high context-switch overhead if quantum is too small. Shortest Job First

Runs the task with the smallest predicted CPU burst next.

Minimizes average wait time, but long tasks risk starvation.

Priority Preemptive

Immediately interrupts lower-priority work when a critical task arrives.

Essential for real-time systems; requires priority aging to prevent starvation.

3. Virtual Memory & Concurrency Hazards

Paging & Translation: Virtual addresses split into fixed-size pages mapped to physical RAM frames via page tables, allowing programs to exceed physical RAM using disk swap space. Race Conditions & Mutexes: When threads read/write shared state concurrently without coordination, results become unpredictable. A Mutex (Mutual Exclusion Lock) ensures only one thread enters a critical section at a time.

NEW READY RUNNING EXIT WAITING (I/O)

Exam Checklist: Four Necessary Conditions for Deadlock

Deadlock occurs only when all four hold simultaneously: (1) Mutual Exclusion on resources, (2) Hold and Wait while requesting more, (3) No Preemption of held locks, and (4) Circular Wait chain among threads. Breaking any one condition prevents deadlock.