|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
|
|
Packit |
423ecb |
TD {font-family: Verdana,Arial,Helvetica}
|
|
Packit |
423ecb |
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
|
|
Packit |
423ecb |
H1 {font-family: Verdana,Arial,Helvetica}
|
|
Packit |
423ecb |
H2 {font-family: Verdana,Arial,Helvetica}
|
|
Packit |
423ecb |
H3 {font-family: Verdana,Arial,Helvetica}
|
|
Packit |
423ecb |
A:link, A:visited, A:active { text-decoration: underline }
|
|
Packit |
423ecb |
</style><title>Thread safety</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"> | | The XML C parser and toolkit of GnomeThread safety |
|
|
<center>Developer Menu</center> | <form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form> |
<center>API Indexes</center> | |
<center>Related links</center> | |
|
| Starting with 2.4.7, libxml2 makes provisions to ensure that concurrent |
|
|
|
|
|
|
Packit |
423ecb |
threads can safely work in parallel parsing different documents. There is
|
|
Packit |
423ecb |
however a couple of things to do to ensure it:
|
|
Packit |
423ecb |
configure the library accordingly using the --with-threads options
|
|
Packit |
423ecb |
call xmlInitParser() in the "main" thread before using any of the
|
|
Packit |
423ecb |
libxml2 API (except possibly selecting a different memory allocator)
|
|
Packit |
423ecb |
Note that the thread safety cannot be ensured for multiple threads sharing
|
|
Packit |
423ecb |
the same document, the locking must be done at the application level, libxml
|
|
Packit |
423ecb |
exports a basic mutex and reentrant mutexes API in <libxml/threads.h>.
|
|
Packit |
423ecb |
The parts of the library checked for thread safety are:
|
|
Packit |
423ecb |
concurrent loading
|
|
Packit |
423ecb |
file access resolution
|
|
Packit |
423ecb |
catalog access
|
|
Packit |
423ecb |
catalog building
|
|
Packit |
423ecb |
entities lookup/accesses
|
|
Packit |
423ecb |
validation
|
|
Packit |
423ecb |
global variables per-thread override
|
|
Packit |
423ecb |
memory handling
|
|
Packit |
423ecb |
XPath has been tested for threaded usage on non-modified document
|
|
Packit |
423ecb |
for example when using libxslt, but make 100% sure the documents
|
|
Packit |
423ecb |
are accessed read-only !Daniel Veillard </body></html>
|