A method and system for threaded resource allocation and reclamation are
provided. In a preferred embodiment, a threaded resource allocation and
reclamation facility ("the facility") provides available instances of a
resource in response to requests from resource consumers. The facility
maintains both a central pool for holding available instances of the
resource for use by any consumer and individual pools for holding
available instances of the resource for use by each consumer. When the
facility receives a request for an available instance of the resource from
a consumer, it provides one from the individual pool for the requesting
consumer. If the individual pool is empty, the facility provides an
available instance of the resource from the central pool. In a further
preferred embodiment, if the central pool is empty, the facility transfers
one or more available instances of the resource from one or more of the
individual pools to the central pool, then provides one of the transferred
available instances.