xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Heninger" <an...@jtcsv.com>
Subject Re: Multithreading question
Date Fri, 02 Feb 2001 18:33:39 GMT
Multi-threaded concurrent read access to the xerces-c DOM document is not
guaranteed safe.  The primary problem is with the reference counted memory
management, which keeps track of how many external (application)
references exist to each node.

Multi-threaded read access to an individual DOMString is safe.  It was set
up this way because DOMStrings, unlike Nodes, do not have an owner
document and there didn't seem to be a reasonable way to restrict them to
a single document.  But keeping them thread safe is one of the
contributing factors to the SMP scalability problems that we're seeing
with the DOM.

Andy Heninger
IBM XML Technology Group, Cupertino, CA

From: "Norris Cheng" <ncheng@quack.com>
> Hi, I understand that in a multithread environment, only one thread can
> enter a DOM tree at the same time, which means i have to do some
> synchronization. So does that mean even for accessor methods such as
> getNodeName, i have to make sure that only one thread is calling it at
> moment?
> What if i am sharing a DOM tree between multiple threads, but the
> are actually accessing different parts of the tree? For instance, if i
> a DOM tree from "<root><a></a><b></b></root>", if
thread A accesses
> "a", and thread B accesses element "b", can that be concurrent? If not,
> would cloning the subtrees solve the problem?
> Thanks

View raw message