[Mono-dev] Patch: XSLT thread safety

Joshua Tauberer jit at occams.info
Mon Jul 14 08:34:12 EDT 2008

Atsushi Eno wrote:
> Thanks for the patch, but I don't think it makes things better.
> It adds extra newobj cost at every transformation time, while we
> could just do it only once. And XslTransform does not have to be
> thread safe. If you use XslTransform in multithread scenario, you
> must create XslTransform for each thread.

Can't the benefits outweigh the costs? There are plenty of newobj's 
throughout XSLT. One more isn't going to change much, and as far as I've 
found it's the only thing preventing XSLT from being thread safe, which 
is a big plus (for me at least).

- Josh Tauberer


"Yields falsehood when preceded by its quotation!  Yields
falsehood when preceded by its quotation!" Achilles to
Tortoise (in "Godel, Escher, Bach" by Douglas Hofstadter)

> Atsushi Eno
> Joshua Tauberer wrote:
>>  From time to time I encounter index out of range errors in 
>> Mono.Xml.Xsl.XslSortEvaluator during my multi-threaded use of a single 
>> XSLT transform object, which I think was due to modifying the state of 
>> a XslSortEvaluator object during the processing of a document.
>> I'm pretty sure the attached patch fixes the problem. At the least it 
>> didn't make things worse for me.
>> I can commit if it's ok, though I don't know/remember how to run the 
>> XSLT tests so I haven't done that. Pointers welcome.
>> ------------------------------------------------------------------------
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list