=?iso-8859-1?Q?Re:_Re:_[xml]_multithreading_issue??=




Daniel Veillard <veillard redhat com> schrieb am 18.10.2004, 14:33:39:
On Mon, Oct 18, 2004 at 01:02:02PM +0200, oliverst online de wrote:

I recognised, that some functions in the libxml2 are calling
xmlInitParser(). Isn't this function supposed to be called before the
parser is being used? And wouldn't there be a multithreading issue with
it, because xmlInitParser() isn't reentrant? 
Think of a multithreaded program, that calls multiple function witha
xmlInitParser() from differnet threads. It would surely call
xmlInitParser() more than once.

  void
  xmlInitParser(void) {
      if (xmlParserInitialized != 0)
              return;

http://xmlsoft.org/threads.html

 "call xmlInitParser() in the "main" thread before using any of the
  libxml2 API (except possibly selecting a different memory allocator)"

it's very clear. Call it before anything else ! If you don't you're not
following the guidelines.

 
I know! That's why I asked for the reason some functions in the libxml2
still call it. If it's the guideline you have to call it, before you do
anything with it, those functions don't need to call it again. And some
other initialisations also seem like they are called twice.



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