Backlinks Graph
Backlinks
Table of Contents

Fast Servers

  2026-03-10

  Edited: 2026-03-10

Old Design

The old design for a server

  1. main loop waits for some event
  2. the loop dispatches tasks based on the file descriptor (fd)
  3. state is stored in the file descriptor and dictates what to do

A worker thread can be created via fork() to handle the task, but using threadpools was more popular. Accepting a connection then just involves adding a fd to the group and then dispatching further events related to that fd.

New Design

Reference