Skip to content

Commit

Permalink
Add additional documentation on maximum number of resources (#33)
Browse files Browse the repository at this point in the history
Fixes #27.

I was looking into what value to set this too when,
I encountered #27 and decided to just fix it in place.

Fix link, add quotes
  • Loading branch information
jappeace committed Oct 23, 2023
1 parent 0a05714 commit 3474c75
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Data/Pool/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ defaultPoolConfig
-- /Note:/ the elapsed time before destroying a resource may be a little
-- longer than requested, as the collector thread wakes at 1-second intervals.
-> Int
-- ^ The maximum number of resources to keep open __across all stripes__. The
-- smallest acceptable value is @1@.
-- ^ The maximum number of resources to keep open __across all stripes__.
-- The smallest acceptable value is @1@ per stripe.
-- If you don't use 'setNumStripes' then set this to the amount of
-- capabilities (using 'GHC.Conc.numCapabilities').
-- If you don't do this your program might crash with "poolMaxResources
-- must not be smaller than numStripes",
-- especially if you move your program to a machine with bigger thread count.
--
-- /Note:/ for each stripe the number of resources is divided by the number of
-- stripes and rounded up, hence the pool might end up creating up to @N - 1@
Expand Down

0 comments on commit 3474c75

Please sign in to comment.