Object Pool Pattern - Handling of Empty Pools

Handling of Empty Pools

Object pools employ one of three strategies to handle a request when there are no spare objects in the pool.

  1. Fail to provide an object (and return an error to the client).
  2. Allocate a new object, thus increasing the size of the pool. Pools that do this usually allow you to set the high water mark (the maximum number of objects ever used).
  3. In a multithreaded environment, a pool may block the client until another thread returns an object to the pool.

Read more about this topic:  Object Pool Pattern

Famous quotes containing the words handling, empty and/or pools:

    It is curious how instinctively one protects the image of oneself from idolatry or any other handling that could make it ridiculous, or too unlike the original to be believed any longer.
    Virginia Woolf (1882–1941)

    The City of New York is like an enormous citadel, a modern Carcassonne. Walking between the magnificent skyscrapers one feels the presence on the fringe of a howling, raging mob, a mob with empty bellies, a mob unshaven and in rags.
    Henry Miller (1891–1980)

    The eastern light our spires touch at morning,
    The light that slants upon our western doors at evening,
    The twilight over stagnant pools at batflight,
    Moon light and star light, owl and moth light,
    Glow-worm glowlight on a grassblade.
    O Light Invisible, we worship Thee!
    —T.S. (Thomas Stearns)