Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Further Reading

Recommended resources for deeper exploration of the topics covered in this course.


General Operating Systems

  • Operating Systems: Three Easy Pieces (Remzi & Andrea Arpaci-Dusseau) Free online textbook. Excellent coverage of virtualization, concurrency, and persistence. ostep.org

  • Linux Kernel Development, 3rd Edition (Robert Love) Practical guide to the Linux kernel internals. Good companion for understanding the kernel side of the system calls Go makes.

  • The Design and Implementation of the FreeBSD Operating System (McKusick et al.) Comprehensive reference for BSD internals, relevant for understanding kqueue and the macOS kernel (XNU/Darwin).

Go Runtime Internals

Scheduling

  • Scheduling: Introduction (OSTEP Chapter 7) Covers basic scheduling algorithms: FIFO, SJF, STCF, Round Robin.

  • Multi-CPU Scheduling (OSTEP Chapter 10) Covers work stealing, per-CPU run queues, and load balancing — directly relevant to the Go scheduler design.

  • Work-Stealing scheduling (Blumofe & Leiserson, 1999) The foundational paper on work-stealing for parallel computation. “Scheduling Multithreaded Computations by Work Stealing”, JACM 46(5).

  • Contention-Aware Scheduling — Background on why the Go scheduler uses spinning threads and careful spinning→non-spinning transitions.

Concurrency and Synchronization

  • Futexes Are Tricky (Ulrich Drepper) Essential reading for understanding how futex-based mutexes work. Covers the subtleties of the futex API that Go’s lock_futex.go navigates.

  • The Little Book of Semaphores (Allen Downey) Free online book with dozens of synchronization problems and solutions. greenteapress.com/semaphores

  • Communicating Sequential Processes (Tony Hoare, 1978) The theoretical foundation for Go’s channel-based concurrency model. usingcsp.com

  • Share Memory by Communicating (Go blog) Explains Go’s concurrency philosophy. go.dev/blog/codelab-share

Memory Management

  • TCMalloc: Thread-Caching Malloc (Google) The allocator design that inspired Go’s mcache/mcentral/mheap hierarchy. google.github.io/tcmalloc

  • Virtual Memory (OSTEP Chapters 13-23) Comprehensive coverage of address spaces, page tables, TLBs, and memory management policies.

  • Garbage Collection Handbook (Jones, Hosking, Moss) Authoritative reference on GC algorithms. Covers tri-color marking, write barriers, and concurrent collection.

I/O and File Systems

  • The epoll API (Linux man pages) man 7 epoll — explains edge-triggered vs level-triggered semantics.

  • kqueue and kevent (FreeBSD man pages) man 2 kqueue — BSD’s event notification interface.

  • The C10K Problem (Dan Kegel) Classic article on handling 10,000+ concurrent connections, motivating the design of epoll/kqueue and event-driven architectures.

  • I/O Multiplexing (OSTEP Chapter 36) Covers the evolution from blocking I/O to select/poll/epoll.

Go Source Code Exploration

The following files are the most rewarding to read in full:

FileLinesTopic
runtime/proc.go8125Scheduler (start with lines 24-116)
runtime/chan.go970Channel implementation
runtime/select.go806Select statement
runtime/sema.go542Semaphore with treap
runtime/stack.go1430Stack management
runtime/netpoll.go733Network poller interface
runtime/netpoll_epoll.go177epoll implementation
runtime/netpoll_kqueue.go184kqueue implementation
runtime/malloc.go2553Memory allocator
runtime/mgc.go2333Garbage collector
runtime/runtime2.go1520Core data structures

Tools for Exploration

  • go tool trace — Visualize goroutine scheduling, GC events, and system calls. Generate a trace with runtime/trace package, then view in browser.

  • GODEBUG=schedtrace=1000 — Print scheduler state every second. Shows number of goroutines, threads, and per-P run queue lengths.

  • GODEBUG=gctrace=1 — Print GC statistics after each collection. Shows pause times, heap sizes, and CPU utilization.

  • strace / dtruss — Trace system calls made by a Go program. Useful for seeing the raw syscalls behind Go’s abstractions.

  • perf (Linux) — Profile CPU usage, cache misses, and context switches. Can reveal scheduler overhead and synchronization contention.