Jump to content

Pool (computer science)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 94.126.240.2 (talk) at 06:45, 29 April 2010. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

An pool in computer science is a set of initialised resources that are kept ready to use, rather than allocated and destroyed on demand. A client of the pool will request an object from the pool and perform operations on the returned object. When the client has finished with an object (or resource), it returns it to the pool, rather than destroying it.

Pooling of resources can offer a significant performance boost in situations where the cost of initializing a class instance is high, the rate of instantiation of a class is high, and the number of instances in use at any one time is low. The pooled resource is obtained in predictable time when creation of the new objects (especially over network) may take variable time.

However these benefits are mostly true for objects which are expensive with respect to time, such as database connections, socket connections, threads and large graphic objects like fonts or bitmaps. In certain situations, simple object pooling (which hold no external resources, but only occupy memory) may not be efficient and could decrease performance [1]

Special cases are:

It can also refer to a Design Pattern to implement them in object oriented languages:

References

  1. ^ Java theory and practice: Urban performance legends, revisited [1]