Re: [xml] IO callbacks are not thread-safe
- From: Michael Ludwig <mlu as-guides com>
- To: xml gnome org
- Subject: Re: [xml] IO callbacks are not thread-safe
- Date: Mon, 06 Apr 2009 18:36:25 +0200
Nick Wellnhofer schrieb:
The input and output callbacks of libxml are stored in static arrays
in xmlIO.c, so any use of the callback functions is not thread-safe.
If someone has time to explain this to the uninitiated: What are these
input and output callbacks of libxml? Or are they not part of the Perl
interface, just part of the C interface?
In many cases this shouldn't be a problem, if callbacks are registered
only at the start of a program. But the Perl bindings register and
unregister callbacks every time a document is parsed. I can reproduce
random segfaults or other errors when processing many thousand
documents in concurrent threads with the libxml Perl bindings.
Two unrelated questions, just to satisfy my curiosity:
What are the benefits of processing documents concurrently? Or rather,
are there any without multiple processors? And can you control the
number of processors to be engaged by Perl?
Could you post a sample of how to achieve this concurrent use of LibXML
] [Thread Prev