79827390

Date: 2025-11-22 15:20:57
Score: 1.5
Natty:
Report link

For handling multiple clients in a C server, threads, forks, and non-blocking I/O (select/poll/epoll) each have trade-offs: forking is simple and robust but heavy due to process overhead; threading is lighter and easier to share state but requires careful synchronization; non-blocking I/O with select/poll/epoll scales best, avoids per-client stacks, and is the common choice for high-performance servers, though it’s more complex to implement. For a small HTTP library, the usual recommendation is non-blocking sockets with select/poll (or epoll on Linux) because it’s efficient, avoids threading complexity, and works well for many simultaneous clients while keeping the code relatively simple.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Ethan Parker