[jdom-interest] static data needs to be thread data for multithreaded application s

Nick Reeves Nick.Reeves at gtl.com
Tue Sep 19 07:40:03 PDT 2000


Let me make clear first of all I am not asking for individual JDOM Objects
to be thread safe. I fully agree that the caller should be responsible for
this, following the example of the Java Collections API.

However where the class has hidden static data (such as
Namespace.namespaces)the class must be responsible for making access to this
thread safe otherwise multithreaded applications such as your typical Web or
EJB case, have no choice but to single thread all use of the JDOM packages
:(. This would lead to appalling performance in any realistic use.

At present multihreaded use of Namespace.getNamespace even indirectly (eg by
importing files in different threads) will cause random failures with
ConcurrentModificationException.




More information about the jdom-interest mailing list