About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Scalability

Another area where asynchronous programming is quintessential is the construction of scalable services. When dealing with many requests, it’s common to initiate the processing for a request on the thread pool. This technique is used to reduce the thread creation and deletion churn that would occur if each request would use a dedicated thread. Because thread creation is rather expensive, it’s better to reuse threads using a pool mechanism.

When using a pool, a critical question to answer is how many threads should be allocated. The ideal number of threads is quite simply the same as the amount of CPUs available. Using fewer threads causes underutilization of the system, which may be warranted if many different services are run on the ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required