From: Vlad Gusev [mailto:vladyslav gusyev gmail com]
Sent: Thursday, April 26, 2007 6:11 PM
To: 'daniel veillard com'
Subject: Re: make libxml2 slightly more thread-friendlyDear Daniel,
Honestly, I spent no time to check my problems with libxml2 in the bug list properly
and found the only close topic in http://mail.gnome.org/archives/xml/2007-February/msg00064.html.
Let me shortly explain the problem. Look, please, at the code sequence starting from xmlReadFile:
xmlReadFilexmlCreateURLParserCtxtxmlNewParserCtxtxmlInitParserCtxtxmlDefaultSAXHandlerInitxmlDoRead
xmlParseDocument
xmlInitParser
xmlInitThreadsInitializeCriticalSection(&cleanup_helpers_cs)xmlDefaultSAXHandlerInit...etc...Thus, there are two calls of xmlDefaultSAXHandlerInit causing in its turn:xmlDefaultSAXHandlerInit__htmlDefaultSAXHandlerxmlGetGlobalStateEnterCriticalSection(&cleanup_helpers_cs)under condition of not main thread. That is the first call of xmlDefaultSAXHandlerInit can access the critical sectionwith no initializing it while the second one is ok.I followed the simple instruction for 2.6.27 Windows version and preserved the default values for cscript-ing configure.js(compiler=msvc, threads=native) with no trying, sorry, to investigate how macros were set. My library build crashedin multithreading environment until I made workaround threads=no.Regards, Vlad