Skip to content

Commit 3474c75

Browse files
authored
Add additional documentation on maximum number of resources (#33)
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
1 parent 0a05714 commit 3474c75

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/Data/Pool/Internal.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ defaultPoolConfig
7777
-- /Note:/ the elapsed time before destroying a resource may be a little
7878
-- longer than requested, as the collector thread wakes at 1-second intervals.
7979
-> Int
80-
-- ^ The maximum number of resources to keep open __across all stripes__. The
81-
-- smallest acceptable value is @1@.
80+
-- ^ The maximum number of resources to keep open __across all stripes__.
81+
-- The smallest acceptable value is @1@ per stripe.
82+
-- If you don't use 'setNumStripes' then set this to the amount of
83+
-- capabilities (using 'GHC.Conc.numCapabilities').
84+
-- If you don't do this your program might crash with "poolMaxResources
85+
-- must not be smaller than numStripes",
86+
-- especially if you move your program to a machine with bigger thread count.
8287
--
8388
-- /Note:/ for each stripe the number of resources is divided by the number of
8489
-- stripes and rounded up, hence the pool might end up creating up to @N - 1@

0 commit comments

Comments
 (0)