[lxml-dev] context parameter thread safety

Stefan Behnel stefan_ml at behnel.de
Mon Sep 8 21:38:15 CEST 2008


Hi,

Alex Klizhentas wrote:
> The context is a first parameter in the xpath/xslt extension functions and
> the tutorial states that it can be used to save function state.
> I wonder whether it is thread safe.

It doesn't have to be. XPath evaluations use an instance-local lock per
evaluator, so their context will not be used concurrently. XSLT objects uses a
new context for each evaluation, so there isn't any context concurrency there
either.

Stefan


More information about the lxml-dev mailing list