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)

    Hast ever ben in Omaha
    Where rolls the dark Missouri down,
    Where four strong horses scarce can draw
    An empty wagon through the town?
    Where sand is blown from every mound
    To fill your eyes and ears and throat;
    Where all the steamboats are aground,
    And all the houses are afloat?...
    If not, take heed to what I say,
    You’ll find it just as I have found it;
    And if it lies upon your way
    For God’s sake, reader, go around it!
    —For the State of Nebraska, U.S. public relief program (1935-1943)

    One merit in Carlyle, let the subject be what it may, is the freedom of prospect he allows, the entire absence of cant and dogma. He removes many cartloads of rubbish, and leaves open a broad highway. His writings are all unfenced on the side of the future and the possible. Though he does but inadvertently direct our eyes to the open heavens, nevertheless he lets us wander broadly underneath, and shows them to us reflected in innumerable pools and lakes.
    Henry David Thoreau (1817–1862)