Re: [xml] when to use initialization



On Thu, May 08, 2003 at 02:35:45PM +0200, Kasimier Buchcik wrote:
Hi,

I've looked at the initialization and cleanup functions like 
"xmlInitParser()" and "xmlCleanupParser".

I would be glad if someone could answer me the following:

   1. If I *don't* use libxml2's thread-support do I have to call
      xmlInitParser() only once per application or once per parsing?

   You don't even need to call it. It's done automatically, it's just better
to do it explicitely in a thread environment.

   2. If I use libxml2's thread-support do I have to call xmlInitParser()
      once per initial thread entry? Or still just once per application?
      Or once per parsing?

   Once per application. At the beginning.

   3. Do I have to call "xmlCleanupParser" only once per application?

   Yes

   4. Do we need to call any other initialization of cleanup functions if
      using the thread-support?

   No, xmlInitParser() names is not really proper anymore it actually
inits the full library.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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