Re: [xml] win32 threads feedback

Stéphane Bidoul wrote:
Hi Igor,

Ho Stéphane

I found out that the thread-enabled libxml2 does not work with the python bindings: it crashes on "if (!tlstate_inited) {".

That's not nice :-)

I think it's because Compiler TLS does not work when the DLL is loaded through LoadLibrary (MSVC documentation).

That is unfortunately true.

Everything looks fine if libxml2 is compiled with threads=native,
which uses TlsAlloc & co.
So you may want to default to threads=native instead of threads=ctls, since it allows for a wider range of usage scenarios.

I dislike that variant very much. Whenever your app creates a thread which calls into libxml, libxml will create an additional one, a courtesy of the braindamaged Windows thread API.

I would personally rather disable threads altogether, but if the public wishes for native threads, native threads they will get :-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]