DotNext.Threading by Roman Sakno

<PackageReference Include="DotNext.Threading" Version="0.12.0" />

 ConcurrentObjectPool<T>

public class ConcurrentObjectPool<T> : Disposable
Provides container for the thread-unsafe objects that can be shared between threads concurrently.
public interface IRental<T> : IDisposable

Represents rented object.

public int Capacity { get; }

Gets total count of objects in this pool.

public int WaitCount { get; }

Gets number of threads waiting for the first available object.

public ConcurrentObjectPool(int capacity, Func<T> factory)

Initializes object pool that will apply Shortest Job First scheduling strategy.

public ConcurrentObjectPool(IEnumerable<T> objects)

Initializes object pool that will apply Round-robing scheduling strategy.

public IRental<T> Rent()

Rents the object from this pool.