Chapter 7. Scalability and Multithreading

As a server-side programmer, my picture of the world is somewhat distorted by my experience. I have never worked on software that was single-threaded. Multithreaded design and implementation is the backbone of server-side programming, but they are definitely not limited to the server alone. Multithreading comes in handy on the client side as well. Why would you want to multithread your software? Three good reasons immediately come to mind:

  • Increased throughput

  • Reduced response time

  • Better CPU utilization

Take a Web server, for example. Practically all of the dominant Web servers are multithreaded. Each incoming HTTP request is assigned to a server thread that will “escort” the request from its arrival until ...

Get Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.