Re: [xsl] Wide Finder in XSLT --> deriving new requirements for efficiency in XSLT processors.

Subject: Re: [xsl] Wide Finder in XSLT --> deriving new requirements for efficiency in XSLT processors.
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 12 Nov 2007 10:18:00 +0000
On 10/11/2007, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> and allocate the processing of the items in the input sequence to the N
> threads in a round-robin fashion. the challenge being of course how to
> marshal the output of the N threads, stitching it back together as a
> sequence in the right order, without using a lot of extra memory and
> creating a lot of extra coordination overhead. The ideal would be that if
> the input sequence is streamed, the output sequence should be streamed too.

Streaming aside (because I've no idea about what that involves), but
just in case you weren't aware.....

In Java 5 you can create FutureTask's which implement "Callable" (like
Runnable but allows a parameterized return type) which you can give to
a fixed size thread pool ExecutorService... you can maintain the order
in an ordered collection, and then just call get() on each one in turn
to construct the output in the right order.  The ExecutorService takes
care of managing the thread pool, Callable allows a return type so you
don't have to mess around there, and get() blocks until complete so
again you don't have to worry about managing that.

Hopefully thats helpful,


cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread