I don\'t want to write my own because i\'m afraid i might miss something and/or rip off other people\'s work, so is there an ObjectPool (or similar) class existing in a library
In the upcoming version of .NET (4.0), there's a ConcurrentBagObjectPool
implementation; in fact the there's an article on MSDN that shows you how to do precisely this.
If you don't have access to the latest .NET framework, you can get the System.Collections.Concurrent
namespace (which has ConcurrentBag
) in .NET 3.5 from Microsoft's Reactive Extensions (Rx) library (in System.Threading.dll).