On 12/27/2012 5:18 PM, David Lee wrote:

I am curious why bother ?

Why not just create a new compiler object in each thread ?

 

I think that's the only simple approach.

I'm just trying to be careful because Saxon gets cranky if you attempt to operate on documents built using one Processor with another Processor, and I would like to be able to cache some objects (documents, etc) that  could be used in multiple threads.  For example, I want to be sure that compiled (XQuery, XSLT) code can be cached and re-used in whichever thread.  So *some* Saxon objects have to be shared across threads, and some should really be per-thread.  I'm just trying to sort out which category the compiler falls into. I think I'm coming to realize that the Processor has to be a singleton, but the compiler should be allocated per-thread.

-Mike