views:

257

answers:

2

any suggestions for a C# object pooling framework? requirements are multi-thread support and a pool size limit, when a thread requests an object but none is available, it's blocked until one of the other objects is freed.

A: 

I don't think there's a framework that will do this for you.

You can implement one yourself with a trivial amount of code though. (1 class, ~20 lines of code)

Have a look at the MSDN article here

Glen
in .Net 4.0 take a look at the System.Collections.Concurrent namespace, many of these are now in the box.
Rick
A: 

Try the enterprise services namespace:

http://msdn.microsoft.com/en-us/library/system.enterpriseservices.aspx

Depending on what you need, this may do the trick for you.

Steve Duitsman