Re: [xml] libxml2 thread safety

1. To make libxml2 thread safe whilst preserving backwards compatibility
as much as possible.
2. One library, which implements all required threaded and non-threaded
3. A guide to migrating existing code (Hopefully, this will be
"recompile existing multi-threaded apps else do nothing").


0. Use the same widely implemented threads package on all supported
platforms to minimize porting work. Currently only pthreads is under

FYI, I'm using libxml2 and libxslt in a multi-threaded environment, which
is not one of the 'widely implemented threads packages' around.

Getting the code to work requires some nasty stuff (mostly on the part of
my application, though), but because of the readily available callbacks
for both memory- and I/O-handling, libxml2 does provide a good part of a
threadsafe framework.

Ofcourse, global variables are a potential problem, but because of the way
I use the library those variables need no mutex-protection in my case.

My suggestion: if possible, don't tie the package to some threads package
or another, perhaps using another abstraction layer which uses callbacks or
macros to perform tasks like locking data or thread-safe I/O (preferably
with an application-supplied context, which the current I/O callbacks are
lacking, hence the 'nasty stuff' ;).


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