Re: [xml] libxml2 and pthreads



On Thu, 2004-08-19 at 21:57, Ben Greear wrote:

Anyway, I've seen other libraries that allowed one to set the lock
callback methods at run-time.  Something like:

That is also my prefered solution (which I've argued several times
in the past.)

I strongly believe that a library should never mandate a theading
model, an I/O model, have a mainloop, nor anything else that might
have global impact on the application. Imagine the situation where
the application has to use two different libraries with incompatible
models. The library should ask the application for such features, if
needed, through callbacks.

Another argument against the current threading situation is that if
you have to use libxml in both a threaded and a non-threaded application
you need two version of libxml. You cannot have just the threaded
version of the library, because linking non-threaded applications
with pthread will cause random crashes during run-time on certain
platforms/compilers.





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