Reinhard Pötz schrieb:
Johannes Lichtenberger wrote:
Hello,

is it even possible to generate threads for instance in a generator? I
assume the SAX events generated wouldn't be in the right order at the
following transformer.

yes, it's your responsibility to take care of the right order of events.
You could consider using a SAXBuffer which stores all events created by
the different threads and finally stream them in the correct order to
the generator's content handler.

As Reinhard mentions above it is technically possible.
As also mentioned above, you have to pay attention to certain things.
Ensuring the correct event order is only one.

You must make sure, that all your threads are finished by the time you're leaving the execute(..) method of your generator. Failing to do so will result in all kinds of trouble, since callers will try to access the result before it is ready and your generator will trigger result prodcution after resources (streams etc) might have been closed.

So far we refrained from adding components that allow threading because of the things mentioned above (creating a large number of threads can be a problem in and of itself) but if you feel that this is a good solution for your problem and you can address all the issues that might arise, go ahead.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to