Thread pool size

  1. If a system has the P processors that have only got the computation type processes (CPU intensive task) then,

    Max Size = P or P + 1

  2. If a system has to perform I/O operation then,

    Max Size = P * (1 + W/S)

    Wait time (W) is the time a thread spends waiting for I/O operations to complete. For example, if a thread performs a read or write operation on a file or network socket, it may have to wait for the operation to complete before it can move on to the next task. Wait time can vary depending on factors such as the I/O device's speed, the number of threads accessing the device, and the complexity of the I/O operation.

    Service time (S) is the time a thread spends performing actual work. This includes tasks such as data processing, computation, or any other operation that does not involve waiting for I/O. Service time can vary depending on the complexity of the task, the size of the data set, and other factors.