Skip to content
academia.sh

Course Intermediate

Operating System Concepts

By the end of this course

Start course

01

Processes and Threads

The process concept, forking, threads, the trade-off between isolation and sharing, and a comparison of scheduling algorithms.

  1. 01 The Process Concept A process as a running instance of a program, and the steps that sharing costs: a process running alone takes 99 time units, but when five processes share the same machine the result is 194 time units and 22 context switches; 44 of those 194 time units go to context switching, which is more than the 39 time units spent on the work itself.
  2. 02 Process Forking A new process derived from an existing one, and measuring what it inherits: four forks carry 64 virtual pages with eager copying, drop to 15 pages with copy-on-write, leaving 49 pages copied for nothing, and copy-on-write loses its advantage once the page fault cost rises to 4 time units.
  3. 03 Threads Shared address space and independent stacks: the same five-unit job, when set up with processes, needs 15 extra virtual pages even with copy-on-write, but drops to 4 stack pages with threads; duration falls from 194 to 186 time units and the context switch count stays unchanged at 22; the gain is 4.12 percent in time and 73.33 percent in memory.
  4. 04 Choosing Between Processes and Threads Counting the trade-off between isolation and sharing: in a single address space, five threads form a single component through shared pages, and any corrupted page spreads to all five units; in a process setup the same corruption stays confined to one unit; the spread ratio is 5.0, and the cost of bringing it down to 1.0 is 15 copied pages.
  5. 05 Scheduling Algorithms Four schedulers, the same workload: non-preemptive FIFO gives 194, round-robin 197, priority 195, fair-share 192 time units; when the quantum drops from 4 to 1, duration rises to 206 and context switches to 36; the ranking changes under the second workload, and no policy is found to be best under both.

02

Concurrency

Race conditions, mutual exclusion tools, deadlock and starvation, memory visibility on multiple cores, and a comparison of three concurrency models.

  1. 01 Race Conditions All interleavings of the read-increment-write triplet, the number of interleavings that produce a wrong result, and how the scheduler's quantum makes the error invisible.
  2. 02 Locks, Mutexes, and Semaphores How mutual exclusion secures the critical section, the cost of contention in time and waiting steps, and what a semaphore gains and what it relaxes.
  3. 03 Deadlock and Starvation Deadlock's four conditions, detecting it through cycle detection on the wait-for graph, lock ordering's structural prevention, and its cost in waiting steps.
  4. 04 Concurrency on Multiple Cores Where real parallelism's contribution to time runs out, the cost paid in idle core steps, and how memory visibility removes the quantum's protection.
  5. 05 Concurrency Models Comparing the thread, event loop, and message passing models on the same workload in terms of time, idle core steps, and correctness guarantee.

03

Memory and Storage

Virtual memory and page replacement, heap allocation and fragmentation, garbage collection pauses, file system abstraction, and input/output models.

  1. 01 Virtual Memory The three costs of paged memory: address translation, page faults, and the choice of page replacement policy — measured by sweeping the physical page count over a 39-access sequence.
  2. 02 Memory Allocation Placing variable-size requests on the heap: the difference between first-fit and best-fit placement on the same event sequence, the moment external fragmentation rejects a request, and the unusable remainder left behind.
  3. 03 Garbage Collection Handing the release decision to the runtime, and its cost: reachability sweeps a 40-object graph, the pause is proportional to the surviving objects, and the pause shrinks as more garbage is collected.
  4. 04 File System Abstraction Turning bytes into names, names into blocks: fitting the 4741 bytes of six files into 512-byte blocks produces 1403 bytes of internal fragmentation, a cost that drops as the block shrinks while indirect blocks and read steps grow.
  5. 05 Input/Output Models Blocking, non-blocking, and asynchronous input/output measured on the same workload: the polling model drives processor utilization to 1.0000 and never changes the duration, the asynchronous model drops duration from 248 to 38.

Start typing to search.

↑↓ Esc navigate · open · close