[jdom-interest] Thread safe question: OK for simultaneous read-only access?

Bradley S. Huffman hip at a.cs.okstate.edu
Sun Oct 28 08:01:35 PST 2001


> > To anyone working on this, I'd like locking at the branch level :)
> 
> Do you mean the Element level?
> 
> The only problem I see with that is, given:
> 
> 	<a>
> 		<b>
> 			<c/>
> 		</b>
> 	</a>
> 
> If one thread is processing <c>, and another takes <b>, and removes
> it from the document altogether, then where does that leave the guy
> processing <c>?

Does he really care?  His view is at <c> and it's descendents.  Now the
guy who takes <b>, his view is at <b> and it's descendents. He doesn't
want that view to change which means he'd have to have a lock on <b>
and all of it's descendents which includes <c>.  However this is
starting to get into a lot of overhead and in most situations is not
needed.  But if anyone is bored?

> I doubt that JDOM will ever include any sort of locking.

Agreed, to many issues.



More information about the jdom-interest mailing list