c-dev@xerces.apache.org
[Top] [All Lists]

Re: MemBufInputSource Core Dump

Subject: Re: MemBufInputSource Core Dump
From: Boris Kolpackov
Date: Thu, 11 Dec 2008 07:41:21 +0200
Hi Nicholas,

Thayer_Nicholas@xxxxxxx <Thayer_Nicholas@xxxxxxx> writes:

> So initializing and terminating the xerces-c library could result in 
> a failure?

If you do it from multiple threads and don't have proper synchronization.
See this FAQ item for details:

http://xerces.apache.org/xerces-c/faq-parse-3.html#faq-4

> Also, does each module need to call initialize/terminate on the 
> xerces-c library?  We dynamically load DLLs that use Xerces 
> internally, so any guidance would be helpful.

If your executable is Xerces-aware then the easiest approach 
would be to call Initialize/Terminate from main() and let the
DLLs assume it is initialized.

If this is not the case (e.g., the executable may not know anything
about Xerces-C++), then you will need to call Initialize/Terminate
from each DLL (the support for multiple calls to these functions was
added for this scenario). If DLLs are loaded from the same thread then
you don't need to do anything special. If, however, the libraries may
be loaded from multiple threads concurrently, then you will need to
implement your own synchronization (e.g., a mutex) around calls to
Initialize/Terminate.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: c-dev-help@xxxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>