1.

Is Xstream Thread Safe?

Answer»

Yes. Once the XStream instance has been created and configured, it may be shared across multiple threads allowing objects to be serialized/deserialized concurrently (UNLESS you enable the auto-detection to process ANNOTATIONS on-the-fly). ACTUALLY the creation and INITIALIZATION of XStream is quite expensive, therefore it is recommended to keep the XStream instance itself. If you absolutely have to rely on annotation processing on the fly, you will have to use separate XStream instances for each thread - either by using every time a new instance or by a shared POOL.

Yes. Once the XStream instance has been created and configured, it may be shared across multiple threads allowing objects to be serialized/deserialized concurrently (unless you enable the auto-detection to process annotations on-the-fly). Actually the creation and initialization of XStream is quite expensive, therefore it is recommended to keep the XStream instance itself. If you absolutely have to rely on annotation processing on the fly, you will have to use separate XStream instances for each thread - either by using every time a new instance or by a shared pool.



Discussion

No Comment Found