[lxml-dev] objectify.fromstring vs etree.fromstring in threaded environment
Stefan Behnel
stefan_ml at behnel.de
Wed Feb 21 15:45:01 CET 2007
Hi Holger,
Holger Joukl wrote:
> Hi,
> just a quick question:
> Can it be problematic to use objectify.fromstring() in a threaded
> environment?
> If I'm not getting it wrong, etree.fromstring() replicates (copies) the
> default
> parser for each thread context, whereas objectify.fromstring just uses
> its default parser regardless of threading contexts.
> Ain't that dangerous wrt to what the FAQ says?
Access to parsers is serialised through parser-local locks. Concurrent access
will therefore never lead to parallel use of a parser. Objectify inherits this
behaviour.
Regards,
Stefan
More information about the lxml-dev
mailing list