Howto: Thread safe object pool

Stephane Carrez from has written a new article at the Java 2 Ada blog:

Thread safe object pool to manage scarce resource in application servers

Stephane presents two solutions on how to build a thread safe object pool: One in Java and one in Ada. I think it’s interesting to see how the two languages solve this classic problem.

I do though wonder why Stephane has chosen to include a Set_Size procedure in the Ada example, instead of just adding size as a parameter to the Util.Concurrent.Pools instantiation. Also I would probably have used one of the Ada.Containers to hold the pool of objects, instead of a plain array. This would have, I think, simplified the code. Maybe this is a good subject for a new Ada-DK wiki article? It has been a while since I last added something to our wiki. Things to ponder…

Leave a Reply