Repository navigation
Thread safety
#160
|
Hi, I've seen an old closed issue regarding thread safety, but didn't really understood the general case. If I have two shared_ptrs sharing the same pool allocator, then allocating/deleting them from two different threads is problematic, right? |
Answered by
foonathan
Mar 8, 2023
Replies: 1 comment
|
Yes, it's not thread safe. You can use https://memory.foonathan.net/classfoonathan_1_1memory_1_1thread__safe__allocator.html instead of the pool to make it thread safe. |
0 replies
Answer selected by
marcovc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it's not thread safe. You can use https://memory.foonathan.net/classfoonathan_1_1memory_1_1thread__safe__allocator.html instead of the pool to make it thread safe.