[Mono-dev] Patch: XSLT thread safety

Steve Bjorg steveb at mindtouch.com
Thu Jul 17 11:40:49 EDT 2008


Well, for one, it would be thread-safe if its only state where stored  
in the invocation stack instead of the object, but that's besides the  
point. :)

 From doing a search on the topic, it appears that Microsoft and MVPs  
alike are promulgating the myth of thread-safety for the Transform()  
method.  As for using msxsl:script in XSLTs is considered unsafe at  
every level.  So, imho, shouldn't factor into the discussion.

What would it take to move this argument from "I think this vs. you  
think that" and instead get a definitive resolution on the matter  
(since official documentation isn't sufficient)?

- Steve

--------------
Steve G. Bjorg
http://wiki.mindtouch.com
http://twitter.com/bjorg

On Jul 17, 2008, at 8:19 AM, Atsushi Eno wrote:

> It means that you skipped or don't understand the discussion in the
> sibling thread (wrt thread safety in reality, not nominally and
> incorrectly). You won't be able to logically explain how it could
> become thread safe when it comes to XslCompiledTransform.
>
> For reference, we don't have true XslCompiledTransform. It's just
> a wrapper of XslTransform.
>
> Atsushi Eno
>
> Steve Bjorg wrote:
>> Hmm, except the docs for XsltCompiledTransform explicitly states  
>> that the object is thread-safe once loaded.
>>> Thread Safety
>>> The XslCompiledTransform object is thread safe once it has been  
>>> loaded. In other words, after the Load method has successfully  
>>> completed, the Transform method can be called simultaneously from  
>>> multiple threads.
>> Frankly, loading the XSLT per thread is not an option for us  
>> either.  Hence why we used the XsltCompiledTransform class.
>> - Steve
>> --------------
>> Steve G. Bjorg
>> http://wiki.mindtouch.com
>> http://twitter.com/bjorg
>> On Jul 17, 2008, at 7:49 AM, Joshua Tauberer wrote:
>>> Steve Bjorg wrote:
>>>> XSLTCompiledTransform is thread-safe.  Would that be an  
>>>> alternative for you?
>>>
>>> As far as I know, XSLTCompiledTransform (in Mono) just wraps the  
>>> same code as XslTransformation, so they are equally thread safe.
>>>
>>> The MSDN docs seem to basically say the same thing w.r.t. thread  
>>> safety, as well (and not mentioning scripts and extension  
>>> functions).
>>>
>>> -- 
>>> - Josh Tauberer
>>>
>>> http://razor.occams.info
>>>
>>> "Yields falsehood when preceded by its quotation!  Yields
>>> falsehood when preceded by its quotation!" Achilles to
>>> Tortoise (in "Godel, Escher, Bach" by Douglas Hofstadter)
>



More information about the Mono-devel-list mailing list