commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Knystautas <ser...@lokitech.com>
Subject Pooling impl that doesn't pool
Date Tue, 20 Jan 2004 14:20:41 GMT
I have an app that uses commons pool (Keyed Pool) to efficient keep 
various instances of a heavyweight class in memory (duh).  That works great.

I know believe that the heavyweight class I'm using is now thread-safe, 
so I was thinking that if there was a pool implementation that only 
created one instance (per key) and then would dispose it when it was 
never used again, I could swap in that pool implementation and do 
threadsafe testing without much code rewrite.

Is there such a trivial pool impl available, or does anybody have clever 
suggestions for how to do this?  I figure I could manually go through 
and write a keyed pool impl to do this, but the trick is I do want it to 
eventually reap pool instances for keys that are never used... I just no 
longer want it to create multiple instances for an individual key.

Any tricks would be greatly appreciated.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message