resource-pool

A high-performance striped resource pooling implementation

LTS Haskell 24.49:0.4.0.0
Stackage Nightly 2026-07-09:0.5.0.1
Latest on Hackage:0.5.0.1

See all snapshots resource-pool appears in

BSD-3-Clause licensed by Andrzej Rybczak, Bryan O'Sullivan
Maintained by [email protected]
This version can be pinned in stack with:resource-pool-0.5.0.1@sha256:0008f308ef77bb3d9481b47606613e5ecf3a0a63576619dbb76e8ce43da6bad3,2398

Module documentation for 0.5.0.1

resource-pool

CI Hackage Stackage LTS Stackage Nightly

A high-performance striped resource pooling implementation for Haskell based on QSem.

Changes

resource-pool-0.5.0.1 (2026-07-08)

  • Fix a bug where a thread waiting for a resource would get stuck in the queue indefinitely if resource creation failed in another thread.
  • Fix a potential out-of-bounds array access in stripe selection when the hash of a thread id is negative.
  • Fix a bug where some of the stripes would never be used if the number of stripes was larger than the number of capabilities.
  • Add a test suite.

resource-pool-0.5.0.0 (2025-06-13)

  • Drop support for GHC < 8.10.
  • Use STM based lockless implementation as it results in much better throughput in a multi-threaded environment when number of stripes is not equal to the number of capabilities (in particular with a single stripe).
  • Stop running resource freeing functions within uninterruptibleMask.
  • destroyResource no longer ignores exceptions thrown from resource releasing functions.
  • Change the default number of stripes to 1.
  • Do not exceed the maximum number of resources if the number of stripes does not divide it.
  • Add support for assigning a label to the pool.

resource-pool-0.4.0.0 (2023-01-16)

  • Require poolMaxResources to be not smaller than the number of stripes.
  • Add support for setting the number of stripes.
  • Hide the constructor of PoolConfig from the public API and provide defaultPoolConfig so that future additions to PoolConfig don’t require major version bumps.

resource-pool-0.3.1.0 (2022-06-15)

  • Add tryWithResource and tryTakeResource.

resource-pool-0.3.0.0 (2022-06-01)

  • Rewrite based on Control.Concurrent.QSem for better throughput and latency.
  • Make release of resources asynchronous exceptions safe.
  • Remove dependency on monad-control.
  • Expose the .Internal module.
  • Add support for introspection.
  • Add PoolConfig.