RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TServerWinSocket.ThreadCacheSize Property

Indicates the number of TServerClientThread objects cached for reuse by new connections to client sockets.

Pascal
property ThreadCacheSize: Integer;
C++
__property int ThreadCacheSize;

When ServerType is stThreadBlocking, each new connection that is accepted by the server socket is given a separate execution thread. In order to improve performance, server sockets store these threads in a cache rather than freeing them when the connection is closed. New connections can then reuse threads from the cache, rather than requiring the socket server to create a new thread every time a connection is accepted. 

Set ThreadCacheSize to specify the number of threads that are cached for reuse. The ideal value for ThreadCacheSize depends on the number and frequency of client socket requests received by the server socket. If ThreadCacheSize is too low, the server socket will spend more time freeing and creating threads when client connections are accepted. If ThreadCacheSize is too high, the server socket may unnecessarily lock up the memory for threads that are never reused. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!