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.
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. Includes a practical example that opens a file specified on the command line with proper error handling using perror and EXIT_FAILURE.
Processes
6 lessons
Process Creation with fork()
intermediateIntroduction to process creation using fork(). Demonstrates parent/child relationships, zombie processes, the classic fork-in-a-loop mistake, the fix with wait/exit, and process timing with gettimeofday.
Introduction to Signals
intermediateBasic signal handling using the signal() function. Covers catching SIGINT, ignoring signals with SIG_IGN, setting alarms with SIGALRM, one-shot handlers, and the differences between signal() and sigaction() behavior.
Program Execution with exec()
intermediateReplacing a process image with exec(). Covers the exec family (execl, execlp, execv, execvp), the fork+exec pattern for running child programs, and a practical calculator example split across parent and child.
Windows Process Spawning
intermediateWindows-specific process creation with _spawnl, _spawnlp, and _spawnv. Compares Windows spawn with Linux fork+exec and demonstrates quirky Windows argv parsing. Note: these examples require Windows (process.h) and won't compile on Linux — view the code for reference.
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.