liveBook · Manning

Thread-per-request

As explained in C# Concurrency: Asynchronous and multithreaded programming

A one-thread-per-request server assigns a dedicated thread to handle each client request.

A thread-per-request server accepts a client connection, creates a dedicated thread, and performs that request’s work synchronously. A socket server can read a file and send it over the connection this way. section 6.1

Load behavior

The sample server handles 50 connections with 56 threads and no failures in 8,389 ms. At 200 connections, it records 61 failures, illustrating a scalability limit under load.

How C# Concurrency: Asynchronous and multithreaded programming covers it

How deep it goes
Builds the socket, thread, file-read, and send sequence, then measures connection failures and thread counts under load.
Examples
Demonstrates a static-file TCP server and compares connection capacity, failures, elapsed time, and thread counts.
What you can do after
Build it from scratch using a listening socket, per-connection Thread, synchronous FileStream reads, and socket sends.
How it connects
Connects TCP sockets, multithreading, file I/O, asynchronous servers, and load testing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of C# Concurrency: Asynchronous and multithreaded programming. The section links point to the parts of the book it draws on.