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:

    That a good fit between parental handling and child temperament is vital to help children adapt to the imperatives of their society is a crucial concept that can be applied to other cultures.
    Stella Chess (20th century)

    Poetry is either something that lives like fire inside you—like music to the musician or Marxism to the Communist—or else it is nothing, an empty formalized bore around which pedants can endlessly drone their notes and explanations.
    F. Scott Fitzgerald (1896–1940)

    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)