RE: [xml] thread safe?



Hi there.

Is the nature of the 
unsafe-ness such that
I can handle it by using a mutex to prevent more than one 
thread at a time
from entering any of my code (two sections of code) that use 
libxml or is
it of a more serious nature?

It seems serious enough to me.

If all underlying libraries used by libxml2 are fully reentrant on your
platform and do not require per-thread intialisation and/or cleanup, the
mutex could perhaps save you. In other case, everything but restricting
the calls into libxml2 to a single thread is an invitation for trouble.

I've gone so far as to be nearly ready to deliver product 
that uses it in a
multithreaded way, so this revelation has my heart up in my throat.

First code the product down to the iron and then spend a thought on how
suitable are the third-party libraries you used? Such approach to the
software engineering process guarantees failure sooner or later.

Ciao
Igor




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