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.
Thoughts?
--
Galder ZamarreƱo
Sr. Software Maintenance Engineer
JBoss, a division of Red Hat