[jdom-interest] Best strategy for caching JDom Document instance and provide concurrent read access to it?

Bradley S. Huffman hip at cs.okstate.edu
Thu Jan 8 09:36:04 PST 2004


"Guillaume Berche" writes:

> Then I wonder whether JDom beta 8 or beta 9, would have problems with
> concurrent read accesses. I've haven't yet read the code in details, but I
> think I read somewhere that JDom was internally using lazy initialization
> when traversing the tree and that concurrent accesses to it might cause
> problems. Is this [still] true?

Shouldn't be a problem in 8/9. Pre beta 7 (?) would create the content list
(if it didn't exist) whenever getContent was called in anticipation that the
user might want to add something through the List interface.  This meant the
internal structure got modified just from traversal. 7 and above
create nothing until require by a actual add operation, so read-only
traversal by multiple threads shouldn't be a problem.

Brad



More information about the jdom-interest mailing list