Closed benaadams closed 3 years ago
Change from Stream.CopyTo to Stream.CopyToAsync as that can lead to blocking waits on ThreadPool threads:
Stream.CopyTo
Stream.CopyToAsync
Change from lock to SemaphoreSlim and use await WaitAsync() to queue and reduce lock contention
lock
SemaphoreSlim
await WaitAsync()
Change from
Stream.CopyTo
toStream.CopyToAsync
as that can lead to blocking waits on ThreadPool threads:Change from
lock
toSemaphoreSlim
and useawait WaitAsync()
to queue and reduce lock contention