2. libxml - libxml.setglobalstate.diff

The setglobalstate patch allows an application to make use of the internal ``xmlGetGlobalState'' function provided by libxml2 and adds and adds a ``xmlSetGlobalState''.

libxml makes use of many global variables kept in a task specific area (when multithreading is enabled) to avoid race conditions with other threads. However, this is not enough for mod-xslt: many apache modules share the same thread of execution and thus share the same ``task specific'' libxml data. To avoid interactions with other modules using libxml, mod-xslt saves the global execution state and restore it for each processed request. The process of ``storing'' and ``restoring'' is in facts a ``copy'' of a memory area (using memcpy). However, libxml internally uses a much more efficient mechanism that would allow mod-xslt to ``store'' and ``restore'' a single pointer on most POSIX systems (using POSIX threads).

The highlited patch allows an application (like mod-xslt) to make use of those functions improving overall performance.

The patch is automatically detected by mod-xslt ``configure'' and should not cause any harm to other applications.