Re: [xml] Thread safety question



On Sat, Jan 05, 2002 at 07:36:03AM -0800, Brent R. Matzelle wrote:
Is it possible to have multiple threads reading (not altering) a
single xmlDocPtr at the same time or will I require a mutex?  I read

  It requires a mutex.

the Thread safety document on xmlsoft but I would like to make sure.

  Only parsing is thread safe (and assuming the library got compiled
with the adequate options). Putting locking at the tree access level
would put a terrible burden on apps not requiring it. It's both simpler
and more efficient in most case to let the application do the locking
to protect concurrent tree accesses.

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]