cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Dolg <steven.d...@indoqa.com>
Subject Re: Multithreading within a pipeline component.
Date Fri, 11 Dec 2009 10:58:54 GMT
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message