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:

    Many more children observe attitudes, values and ways different from or in conflict with those of their families, social networks, and institutions. Yet today’s young people are no more mature or capable of handling the increased conflicting and often stimulating information they receive than were young people of the past, who received the information and had more adult control of and advice about the information they did receive.
    James P. Comer (20th century)

    The river’s tent is broken; the last fingers of leaf
    Clutch and sink into the wet bank. The wind
    Crosses the brown land, unheard. The nymphs are departed.
    Sweet Thames, run softly, till I end my song.
    The river bears no empty bottles, sandwich papers,
    Silk handkerchiefs, cardboard boxes, cigarette ends
    Or other testimony of summer nights.
    —T.S. (Thomas Stearns)

    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)