Alex Klizhentas | 8 Sep 17:21

context parameter thread safety

Hi All,

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.

Regards,
Alex
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Stefan Behnel | 8 Sep 21:38

Re: context parameter thread safety

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

Gmane