[infinispan-dev] Object Stream Pooling design
Manik Surtani
manik at jboss.org
Tue May 26 12:33:47 EDT 2009
On 26 May 2009, at 09:01, Galder Zamarreno wrote:
> Hi,
>
> Re: https://jira.jboss.org/jira/browse/ISPN-42
>
> I can see two clear options when trying to implement this together
> with JBoss Marshalling.
>
> One would be to use some sort of blocking queue like Manik did for
> JBC 2.1.0.GA. The other option would be to simply use two thread
> local instances (one for marshaller and one for the unmarshaller).
>
> The main advantages of thread locals would be reducing contention by
> not having a shared data structure and simplicity configuration
> wise, no need to define pooling parameters...etc.
>
> The main disadvantages of thread locals would be any potential leaks
> arising from marshaller/unmarshaller. Having talked to David and
> having checked the JBMAR code, whenever a message needs to be
> written, we'd be calling start() and the finish() on the marshaller/
> unmarshaller, and as long as finish() was called on a finally, we're
> guaranteed that we won't be leaking any user classes/instances via
> the marshaller/unmarshaller.
>
> Most of the environments these days run on some sort of pooled
> thread strategy and hence thread locals would be certainly improve
> performance.
>
> So, my current preference, would be to simply use thread locals for
> this.
+1 to your approach.
Anything that makes configuration simpler is good for me. :)
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
More information about the infinispan-dev
mailing list