the c10k problem

The C10K problem

I/O frameworks

Prepackaged libraries are available that abstract some of the techniques presented below, insulating your code from the operating system and making it more portable.

  • ACE
    • Reactor is an OO way of doing nonblocking I/O
    • Proactor is an OO way of doing asynchronous I/O
  • ASIO

  • libevent

I/O Strategies

Designers of networking software have many options. The following five combinations seem to be popular:

  • Serve many clients with each thread, and use nonblocking I/O and level-triggered readiness notification
    • The traditional select()
    • The traditional poll()
    • /dev/poll
    • kqueue()
  • Serve many clients with each thread, and use nonblocking I/O and readiness change notification
    • kqueue()
    • epoll
    • Realtime Signals
    • Signal-per-fd
  • Serve many clients with each server thread, and use asynchronous I/O

  • serve one client with each server thread, and use blocking I/O

  • Build the server code into the kernel