Skip to content

Sharing BufferPool across Simulations and other consumers #129

Answered by RossNordby
Frooxius asked this question in Q&A
Discussion options

You must be logged in to vote

Glad you're liking it!

The bad news is that using a BufferPool simultaneously on multiple threads will indeed corrupt it- it does not provide any kind of thread safety.

The good news is that having multiple BufferPools is totally fine. Only potential concern would be a little bit of memory capacity waste if the pools are used for a few tiny allocations, since the backing allocations are going to be fairly large by default. You can give a smaller block size to the constructor to help with that if it's an issue. (That kind of use case would also benefit from moving the BufferPool from LOH allocations to POH or native allocations, which is on the todo list and is very easy to do.)

Notably, t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Frooxius
Comment options

@RossNordby
Comment options

Answer selected by Frooxius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants