commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. Biesack" <>
Subject Re: codec - thread safe
Date Mon, 08 Oct 2007 13:01:51 GMT
> Date: Sat, 6 Oct 2007 23:31:19 -0500
> From: "Qingtian Wang" <>
> Well, it's pick-your-poison kind of a deal. Either block on one
> instance and take a performance hit, or burn up the memory with lots
> of instances.....

Why not compromise? Create a ThreadPoolExecutor of some reasonable size and submit a FutureTask
to run the encode or decode, and then do a future.get() when the value is needed. You might
even get some concurrency if you can start the encode, then continue doing other work
until you need the result.

David J. Biesack     SAS Institute Inc.
(919) 531-7771       SAS Campus Drive   Cary, NC 27513

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message