I create a buffer manager through static member of BufferManager.CreateBufferManager
. This new created BufferManager
is used by multiple threads.
Should I use a lock
with TakeBuffer()
and ReturnBuffer()
or it is thread-safe by design ?
Internally BufferManager.CreateBufferManager
returns an instance of WrappingBufferManager
which employs no form of concurrency control, but wraps multiple instances of SynchronizedPool<T>
which employ internal locking when Take()
ing a new buffer. So judging by the simplicity of the WrappingBufferManager
, it's safe to assume that any locking on your part would be redundant, and the returned class is in actual fact thread safe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With