Re: [xml] win32 threads feedback



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.

That second thread is for freeing the global state when the first thread
terminates, right? I think one could achieve the same result by
using a DllMain and allocating the global state on DLL_THREAD_ATTACH,
and freeing on DLL_THREAD_DETACH. But that would
not work if libxml2 is linked statically, of course...
Would it make sense to implement that?

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

Well, I will need a thread safe libxml2, for the single mutex protecting
the global catalog (?).
What I'm not sure, is why I need to have the globals instantiated per
thread, since they seem to be used as default values only?

-sbi





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