Pool (computer science)
In computer science, a pool is a set of pre-initialized resources that are ready for use at any time, instead of being allocated every time when necessary and then destroyed again. A client requests an object from the pool and performs operations on the returned object. When the client is done with the object, it returns it to the pool instead of destroying it.
Pooling can lead to a significant increase in performance in situations in which the initialization costs or times of instances of a resource are high, but their simultaneous number is low . The instance of a resource in the pool can be obtained in a predictable time, while the creation of new instances (especially over the network) can take different lengths of time. However, the advantages mostly apply to resources whose initialization time is long , such as database connections , sockets or thread and graphic objects such as fonts or bitmaps .
Examples
- A connection pool is a cache for database connections.
- A proxy pool is a cache for connections to web services .
- When storage pool a place Default equal instead of large memory blocks.
- With the printer pool , print jobs are automatically distributed among printers .
Design pattern
Design patterns are tried and tested approaches to solving common problems; pooling mechanisms are the basis of the following design patterns:
- A thread pool is used to process tasks, usually from a queue , by a pool of threads. The thread pool is managed by a process scheduler .
- An object pool is used in the imperative - Object Oriented -Software to an object to keep alterable state for later use in memory.
swell
- ^ Wenlong Dong: A Sample for WCF Client Proxy Pooling. In: Wenlong Dong's Blog, MSDN. Microsoft, November 14, 2007, accessed July 13, 2014 .