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

Jason Hunter jhunter at acm.org
Fri Sep 22 08:16:37 PDT 2000


> What's the procedure for this I can't find anything on the website.

People just send in the "cvs diff -u" or without CVS just a diff -u.

> The actual patch is trivial it's just a matter of add a 
> synchronized block in getNamespace as marked with ++ below, 
> and some suitable comments on synch policy.

That's the easy way.  :-)  But I was wondering if there could be an
optimization (it's important here, this code is called all the time). 
Like for example you could put "if not contains then add" in the sync
block and handle the return and the corresponding hash lookup outside
the block.  That'd shorten the crit section.  

Plus I was hoping you could run some tests with the code you have that
you thought would expose this problem, and make sure you can reproduce
the problem before and not after.

-jh-



More information about the jdom-interest mailing list