PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3240 *** shadow/3240 Wed Aug 22 17:12:59 2001 --- shadow/3240.tmp.10670 Wed Aug 22 17:12:59 2001 *************** *** 0 **** --- 1,55 ---- + +============================================================================+ + | Doubts if SAX2 parser is thread-safe | + +----------------------------------------------------------------------------+ + | Bug #: 3240 Product: Xerces-C++ | + | Status: NEW Version: 1.5.1 | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: SAX/SAX2 | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Trying to narrow down a problem why my code is crashing when run in a number of + threads - I ended up with a piece of code that uses only xerces classes. The + following function crashes very quickly if run in 2000 threads on NT 2000. I + understand that number is too big, but still this behavior makes me suspect + that something is not clear in xerces. + + Thanks, + Simon! + + void parse( void* ) { + try { + const char xml[] = "<?xml version=\"1.0\" encoding=\"UTF-8\" ? + <CONFIGURATION/>"; + const int len = strlen(xml); + + for (int i=0; i<200; i++) { + SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); + DefaultHandler def; + parser->setContentHandler(&def); + parser->setLexicalHandler(&def); + parser->setErrorHandler(&def); + + MemBufInputSource input( + (const XMLByte*)xml, + len, + "MemoryBuffer", + false); + parser->parse( input ); + delete parser; + } + std::cout << "*" << std::flush; + } + catch (const XMLException& toCatch) + { + std::cerr << "\nAn error occured\n Error: " + << toCatch.getMessage() + << "\n" << std::endl; + return; + } + } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
