skip to main content
Introduction : About Threading Models : Returning Threads to the Thread Pool
 

Returning Threads to the Thread Pool

OpenAccess SDK allows you to accommodate idle periods and heavy workload traffic by setting service attributes that let you govern when threads are returned to the thread pool, and consequently, when the threads become available to service other client connections.
The DataSourceThreadMaxRpc attribute specifies the maximum number of data access requests to be accepted from the same client before the thread allocated to that connection is returned to the thread pool. For example, if DataSourceThreadMaxRpc=10, the thread will not be returned to the thread pool until after 10 requests have been made. When the time specified by the DataSourceThreadRpcTimeOut attribute has been exceeded, the thread is returned to the thread pool to serve another connection. This attribute avoids a client connection monopolizing a thread by not responding to it in a timely manner. See DataSourceThreadMaxRpc for more information.
The ServiceThreadLockThreshold attribute specifies a percentage of the value specified by the ServiceMaxThreads attribute. When the number of active threads is less than this percentage, a connection that has executed more RPCs than the value specified by the DataSourceThreadMaxRpc attribute on the current thread is allowed to lock this thread for the time specified by the DataSourceThreadRpcTimeOut attribute. For example, if ServiceMaxThreads=10 and ServiceThreadLockThreshold=50, and only 4 threads are active, a connection can lock the thread it is using for another time period specified by the DataSourceThreadRpcTimeOut attribute. See ServiceThreadLockThreshold for more information.
These data source attributes ensure that the OpenAccess SDK Server can continue to process additional client data access requests, even under heavy workload conditions that can cause all threads to be active concurrently.