Project

Profile

Help

Using Saxon in a parallel for-each loop in .Net

Added by Martin Smith almost 10 years ago

Greetings,

I have been working with the .Net version of Saxon in the C# .Net environment. I have written a batch processing application that runs an XSL transform on all of the XML files in a selected folder. The application makes use of the parallel for-each loop in .Net 4.5 for file processing, with .Net queuing up the files to run on multiple threads. Each trip through the loop creates an instance of the class that I use to transform a file using Saxon.

When the application runs, it is obvious that there is a bottleneck with the transform processing. The system is unable to utilize all eight cores in the workstation. Even though multiple instances of the transform class are created, the transforms still seem to run on a single thread.

Is there a way of working around this problem, or is this an inherent limitation of Saxon. Does the enterprise version support running multiple instances in this manner?

Thanks,

Martin


Replies (1)

RE: Using Saxon in a parallel for-each loop in .Net - Added by Michael Kay almost 10 years ago

There's nothing intrinsic in Saxon that causes multiple XsltTransformer objects derived from the same XsltExecutable to block on each other (or if there is, there's a bug). I assume the "class that you use to transform a file" creates a new XsltTransformer.

I'm afraid that to make progress on this, we're going to have to find out what it's blocking on. I've limited experience in investigating concurrency issues on .NET; we've done more of this kind of thing on the Java platform.

    (1-1/1)

    Please register to reply