Operating Systems & C Programming
A comprehensive systems programming course covering processes, signals, inter-process communication, sockets, threads, and synchronization — all in C on Linux. Progresses from C fundamentals through fork/exec, pipes, shared memory, and pthreads, culminating in real-world concurrent systems like chat servers, bank simulations, and the dining philosophers problem.
Concept Map
Foundation
2 lessons
Introduction to C
beginnerTransition from C++ to C. Covers scanf/printf, string handling with fgets, file I/O using fopen/fclose, structs, complex format specifiers, functions with pointer parameters, and dynamic 2D allocation.
Command-Line Arguments
beginnerUsing argc and argv to accept command-line arguments: they arrive as strings (atoi vs strtol), options like -n 3 with a usage message, exit codes, and files named on the command line — open, count and copy them with perror and EXIT_FAILURE.
Processes
6 lessons
Process Creation with fork()
intermediateProcess creation with fork(): the child gets a copy of memory (and of the output buffer), the classic fork-in-a-loop mistake and its fix, decoding how a child ended with waitpid(), a live zombie and an orphan, and timing with gettimeofday.
Introduction to Signals
intermediateSignals with signal(): default actions, catching and ignoring SIGINT, kill() between processes and the kill command from another terminal, SIGALRM timers, one-shot handlers, the safe flag pattern for a graceful shutdown, and signal() vs sigaction().
Program Execution with exec()
intermediateReplacing a process image with exec(): same PID, never returns on success, -1 and errno when it fails. The exec family (execl, execlp, execv, execvp, execle), the fork+exec pattern with a calculator, open files and environment across exec, and a tiny shell that runs your commands.
Process Spawning: Windows and Linux
intermediateSpawning a program in one call. Read the Windows versions (_spawnl, _spawnlp, _spawnv with _P_WAIT/_P_NOWAIT, and the argv quirks with spaces and *), then run the Linux counterpart posix_spawn — and see that on Linux it is the shell, not spawn, that splits words and expands *.
Advanced Signals with sigaction
intermediateDeep dive into sigaction() — the robust, portable replacement for signal(). Covers the sigaction struct anatomy, sa_mask for blocking signals during handling, SA_RESTART and SA_RESETHAND flags, and SA_SIGINFO for accessing detailed signal metadata.
Signal Coordination
advancedApplied signal programming bringing together fork, exec, and signals. Includes a two-program alarm management system, parent-child coordination using signals, and multiplexing signals across four child processes.
IPC
4 lessons
Pipes
intermediateAnonymous pipes for parent-child IPC. Progresses from the shell pipe operator through the pipe() system call, byte-by-byte reading, dup2 for stdin/stdout redirection, bidirectional communication with two pipes, and an introduction to named pipes (mkfifo).
Named Pipes & Message Queues
advancedTwo IPC mechanisms for unrelated processes. Named pipes (FIFOs) for byte-stream communication between any processes, and System V message queues for structured, typed message passing. Includes multi-writer FIFO, two-way FIFO, and a calculator built on message queues.
Shared Memory
advancedSystem V shared memory for the fastest IPC. Covers shmget/shmat/shmdt/shmctl, sharing structs and arrays between processes, and a multi-program scoreboard architecture with separate creator, updater, and viewer processes.
TCP Sockets
advancedNetwork programming with TCP sockets. Covers the full socket lifecycle (socket, bind, listen, accept, read/write, close), multiplexing with select(), and three complete client-server applications: echo, chat, and an arithmetic evaluator.
Threads
3 lessons
POSIX Threads
advancedIntroduction to multi-threaded programming with pthreads. Covers thread creation, exit and return values, cleanup handlers, join, pthread_once, parallel partial sum, race conditions, and combining threads with other IPC mechanisms like FIFOs.
Synchronization
advancedSolving concurrency problems. Covers the critical section problem, named semaphores, mutexes, and condition variables. Theory-heavy lesson with extensive markdown notes on naive locks, hardware solutions (test-and-set, CAS), and the bakery algorithm.
Advanced Threads & Concurrency
advancedReal-world concurrent programming. Features a CLI loading animation, dining philosophers, a thread-safe bank simulation, a shared canvas, spinner animations, and deep dives into condition variable pitfalls and broadcast vs signal semantics.
Exam Prep
1 lessons