Re: [xml] libxml2 and pthreads

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 xml_thing_that_needs_a_lock);

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).


Ben Greear <greearb candelatech com>
Candela Technologies Inc

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