Patent ID: 7882285

Claim:
A computer-performed method of managing a buffer cache, comprising: determining that a thread executing in a computer requires an allocation of one or more input/output buffers in a buffer cache residing in memory of the computer; determining if performing the allocation would result in the buffer cache having a number of free buffers that is less than a pre-determined threshold; in response to a determination that performing the allocation would result in the buffer cache having a number of free buffers that is less than the pre-determined threshold, increasing a total size of the buffer cache; and in response to a determination that performing the allocation would not result in the buffer cache having a number of free buffers that is less than the pre-determined threshold: determining if performing the allocation would result in the buffer cache having a number of free buffers that is less than a minimum number of buffers needed to perform the action of increasing the total size of the buffer cache, wherein the predetermined threshold is at least as big as the minimum number; in response to a determination that performing the allocation would result in the buffer cache having a number of free buffers that is less than the minimum number of buffers needed to perform the action of increasing the total size of the buffer cache, blocking the thread until the allocation can be performed without the buffer cache having fewer than the minimum number of buffers needed to perform the action of increasing the total size of the buffer cache; and in response to a determination that performing the allocation would not result in the buffer cache having a number of free buffers that is less than the minimum number of buffers needed to perform the action of increasing the total size of the buffer cache, performing the allocation.