concept thread pool in category apache thrift

appears as: thread pools, thread pool, thread pool, thread pools
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

The boilerplate nature of server operation allows Thrift to supply a library of server classes with a wide range of implementations. Different language libraries support different server classes based on the community’s needs and the capabilities of the language. For example, Java offers single and multithreaded servers, as well as servers that use dedicated client threads and servers that use thread pools to process requests, while Go servers use go routines. Concurrency models are the key distinction between the various servers offered (for more server details see chapter 10).

The deleteContext() method is the reciprocal of createContext() 6. Here we check to see if the thread pool is too large, knowing that a thread is about to be freed from service. Because deleteContext() is called before the thread is returned to the pool, we subtract 1 from the active thread count to get correct status() output. The removeWorker() method is used to remove a ThreadManager thread if we have excess threads and are above the minimum. The deleteContext() method also has the responsibility of releasing any memory associated with the connection context allocated in createContext(). In this case, we delete the integer context pointer as the last statement in deleteContext().