You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Anthony Zawacki <zw...@us.ibm.com> on 2004/04/19 15:14:16 UTC

Parse/release thread safe with new memory management?





We have a multithreaded program, that has a thread dedicated to parsing XML
documents.  On some occasions, when we need another thread to process the
document, we call adoptDocument to take control of the document to be
released at a later time.  Eventually, another thread calls release on the
document.  Is this safe?  Or should we somehow pass the document back to
the original thread with the parser to call release?  Is the default memory
management in place thread safe to allow the parser to keep working
independently of the release of the document?  Can one thread with a parser
continuously create documents, and another thread, after adoption of the
document, continuously release the documents without a conflict in the
underlying memory manager?

In the past, we hadn't had many problems with this scheme, however,
recently our program has been coring with stack corruptions.
http://xml.apache.org/xerces-c/faq-parse.html#faq-8 doesn't seem to address
releasing the documents once other threads are done doing their work.  I am
sure that we are following the rules outlined, and only one thread is
accessing a document at a given time.  We are just concerned with the call
to release.


Thanks,
Anthony Zawacki

410-571-7161
zwacki@us.ibm.com