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)

    It was like taking a beloved person to the airport and returning to an empty house. I miss the people. I miss the world.
    Susan Sontag (b. 1933)

    There will be better days when I am gone
    And healing pools where I cannot be healed.
    Fragrant stars will gleam forever and ever
    Above the place where I lie desolate.
    Arna Bontemps (1902–1973)