xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Zawacki <zwa...@us.ibm.com>
Subject Parse/release thread safe with new memory management?
Date Mon, 19 Apr 2004 13:14:16 GMT





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
Mime
View raw message