In an environment in which applications perform multi-tasking by using
threads, the optimum number of threads to be provided to an application
is determined based on historical data. Due to the use of the historical
data, optimum number of threads can be accurately determined, leading to
better response times for service requests, without creating unneeded
overhead on system processing the service requests. In one embodiment,
various status information (of potentially several prior weeks) such as
number of tasks received and pending, system resources status (e.g. idle
processor time and aggregate memory usage in the system), is maintained.
In addition, a table may be maintained to indicate the optimum number of
threads for a given combination of status information values. Thus, based
on the expected status scenario, the optimum number of threads can be
determined and provided at various points of time.