Re: [xml] Thread safety of libXML2?
- From: Daniel Veillard <veillard redhat com>
- To: David Hagood <wowbagger sktc net>
- Cc: xml gnome org
- Subject: Re: [xml] Thread safety of libXML2?
- Date: Thu, 26 Oct 2006 18:50:47 -0400
On Thu, Oct 26, 2006 at 04:33:49PM -0500, David Hagood wrote:
Assume that I have a single xmlSaveCtxtPtr that has been created, and is
visible to multiple threads within a program.
Assume that I have multiple threads creating multiple document fragments
(separate xmlNodePtr objects, one per thread), using various xmlNewChild
and the like calls. Assume that only one thread manipulates any given
xmlNodePtr.
Is the call to xmlSaveTree intrinsically thread safe, or do I have to do
my thread protection outside of xmlSaveTree?
One context per thread like for parsing contexts. Multiple threads
accessing the same xmlSaveCtxtPtr won't be synchronized by libxml2, it will
fail at some point. You need to add your own locking on top.
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
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]