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)

    When I am on a stage, I am the focus of thousands of eyes and it gives me strength. I feel that something, some energy, is flowing from the audience into me. I actually feel stronger because of these waves. Now when the play’s done, the eyes taken away, I feel just as if a circuit’s been broken. The power is switched off. I feel all gone and empty inside of me—like a balloon that’s been pricked and the air’s let out.
    Lynn Fontanne (1887–1983)

    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)