Re: [xml] libxml2 and pthreads

On Thu, Aug 19, 2004 at 12:57:31PM -0700, Ben Greear wrote:
Daniel Veillard wrote:
On Thu, Aug 19, 2004 at 12:32:29PM -0700, Ben Greear wrote:

I do not have to link libpthread for normal malloc and free though,
and when I fork() from a signal handler my program doesn't deadlock
deep in libpthread :)

 Doing anything complex in a signal handler will bite you hard anyway
sooner or later. Advice : don't do this...'s just code to write out the last bit of debugging info
before abort().

Anyway, I've seen other libraries that allowed one to set the lock
callback methods at run-time.  Something like:
xmlSetLock(int my_lock_method(), void* myData, xmlFoo 

  That would force existing threaded apps using libxml2 to change
their initialization code, basically an API/ABI break. Impossible at this
point, sorry !

If you did something like that, then there would be no pthread dependency,
but those that are running multi-threaded apps can provide their own locking
primitives (based off of libpthread or their threading package of choice).

  There is an alternative, at least on Linux/gcc but Jakub never provided
the patch or information on how to really do so:


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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