objectpool icon indicating copy to clipboard operation
objectpool copied to clipboard

Is this objectool multi-threaded safe?

Open guzhongyan opened this issue 1 year ago • 1 comments

Hi @bitshifter , I'm wondering if the objectpool can be used in a multi-threaded case. That means mulitple threads share one object pool to get and return objects. Is it safe? will there be any race condition issues?

guzhongyan avatar Sep 11 '23 08:09 guzhongyan

Hi @guzhongyan. No it's not thread safe, you would need to wrap access with a mutex or something similar to protect from data races.

bitshifter avatar Sep 11 '23 10:09 bitshifter