jackfirth / racket-disposable

An experimental Racket library providing an abstraction for values associated with external resources that allows automatic resource pooling, per-thread virtual construction, and monadic composition
Apache License 2.0
7 stars 0 forks source link

Document single-custodian non-concurrent allocation behavior of pools #73

Closed jackfirth closed 7 years ago

jackfirth commented 7 years ago

Allocation and deallocation of values in a pool occurs in a single manager thread to avoid concurrency problems when manipulating the pool's state. This means 1) all values are allocated under the custodian that was current when the manager thread was created (at pool creation time) and 2) values are allocated one at a time, so 20 threads asking for values simultaneously from an empty pool will block on each other.