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 Veillard      | Red Hat Network
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]