Re: [xml] Newbie Help

On Sat, Aug 14, 2004 at 12:33:02AM -0500, Bryan Christ wrote:
I actually solved my problem.   None of the examples and tutorials
mentioned using xmlXPathInit().  However, because I found a discussion
somewhere about needing to call this function once in a multi-threaded
application I included it in my code.  However, there was nothing (that
I could find) that stated that the call had to be made outside of the
"worker thread".  Since I only need to implement xml and xpath in this
one thread, I was calling xmlXPathInit() in that thread.  Eventually, as
a shot-in-the-dark, I moved it to the calling process, main(), and
everything works now.  Perhaps I have just overlooked the documentation
which details this behavior. 

  That's really strange. xmlXPathInit just do the initialization
of 4 global variables used for +Inf -Inf NaN and -0 handling in
XPath. They are truely global and hence shared by all threads,
so I would really expect xmlXPathInit() to affect all threads
identically. This is not true for all the initializations though
and it's usually better to call the init routine in the main
  Thanks for the feedback, this is bizarre, but hopefully fixed now,


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]