Skip to content

Lexicon Entry

C

C is a general-purpose, procedural programming language that provides low-level memory access and a simple set of keywords. It is widely considered the lingua franca of systems programming.

Related Knowledge & Cross-References

Guide

POSIX Signal Handling: Asynchronous Contexts and Reentrancy

Unpacking asynchronous execution contexts, async-signal-safe functions, and the hidden dangers of reentrancy that make printf and malloc unsafe inside a signal handler.

Guide

Windows Threads and Synchronization: Win32 API and NT Primitives

A deep dive into Windows multithreading. Learn how to manage threads with CreateThread, synchronize using SRWLocks, and build high-performance blocking mechanisms with WaitOnAddress (the Windows futex).

Guide

POSIX Threads and Linux Synchronization: The Magic of Futex

A deep dive into thread creation with pthreads and how Linux avoids system calls in fast path synchronization using futexes.

Guide

The NT Kernel Approach: Understanding Windows Process Creation

A deep dive into the NT Kernel approach to processes. Learn why Windows lacks fork(), the architecture of Windows subsystems like csrss, and how to use CreateProcess in the Win32 API.

Guide

The Anatomy of Process Creation: fork, exec, clone, and COW

A deep dive into how Linux creates processes. We will explore the mechanics of fork(), the magic of Copy-on-Write (COW), and how clone() powers modern containerization.

Musing

Introspecting the Stack: Building a custom backtrace() from scratch

"You want to print a stack trace when your program crashes, but relying on libc's backtrace() feels too much like magic. How does a program actually read its own call stack while running?"

Guide

Write a Compiler from Scratch in C: Build a Working Toy Compiler

Learn how to write a compiler from scratch in C. Build a complete toy compiler with a hand-written lexer, recursive descent parser, and code generator targeting x86-64 and ARM64 assembly.