Re: [xml] thread safe?



Thanks for the replies from all of you!

I don't think I'm in too bad shape, then:
--I'm not using trio (I'm still using 2.2.12 because that's where I started
my development and don't want to change midstream, and 2.2.12 doesn't use
trio)
--I'm carefully using the xx_r functions wherever they exist
--I'm not using libz or iconv or libxslt.
--I'm using only two limited parts of libxml: to build a tree similar to
(but more code) the tree example in the docs, and using callbacks to pull
out two fields from a trivial msg I receive.
--I'm not using libxml to do i/o except for letting it load the dtd from
file when creating my outgoing XML. I'm managing my own network i/o.





Daniel Veillard <veillard redhat com> on 06/26/2001 11:28:36 AM

Please respond to veillard redhat com

To:   Gary Pennington <Gary Pennington uk sun com>
cc:   David Frascone <dave frascone com>, Fred Smith/Computrition,
      xml gnome org
Subject:  Re: [xml] thread safe?




On Tue, Jun 26, 2001 at 03:51:09PM +0100, Gary Pennington wrote:
Hi,

Apologies for the long answer, but it's a complex issue and there are
certain
subtleties which need to be examined.

libxml and libxslt are not thread-aware. That means that unless you take
special
precautions when linking with either library from a multi-threaded
application,
things will go wrong.
  I think the picture given by Gary is a bit pessimistic. Of course if
the libc is broken w.r.t being thread safe, then you have problems.
For the most part people should make sure the library is initialized
properly
before starting a multithreaded task, parsing from 2 different files
should work, ith there is some associated network access, then yes it will
be more dependant on the few underlying function used. I don't know
if iconv and libz are thread safe, I hope so. libxml don't call any other
library.
  errno is used only for error case identification in the encoding and
I/O part, I would be glad to be able to remove it's use if it was
possible.
  localtime is used only by the memory debug save, it will never be called
by applications
  strtok is used by trio, so basically if your platform is decent, it
will never be used.
Daniel
--
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Sep 17-18 2001 Brussels Red Hat TechWorld http://www.redhat-techworld.com
_______________________________________________
xml mailing list
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml










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