Hi ,
>
> Thanks.
>
> The FAQ does say that
>
> "The same rules apply to Xerces-C++ DOM documents. Multiple document
> instances may be concurrently accessed from different threads,
> but any given
> document instance can only be accessed by one thread at a time"
>
> Does that mean that even though we can pass DOM Documents between
> threads,
> two threads must not access them at the same time ?
Yes.

> That would mean that on a Single processor system the two threads would be
> able to access a document (since they can never do so at the same
> instance)
> but on a Multiprocessor System it would fail.

No, this is not correct.  Threads can be preempted at any time.  Imagine one
thread calls into a DOM method and is preempted half way through.  Another
thread may now be scheduled, and begin executing another method call on the
same document.  Now we have the DOM being accessed by two different threads
concurrently - bang.

The way around this is to lock your documents (OS dependent, but Xerces
provides some mutexes/etc if you need to do this cross platform), so that
only one thread can access them at a time.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to