|
From: Bruce M. <br...@mc...> - 2003-07-16 03:09:00
|
Jonathan, all: I have been trolling around this code tonight and here are my observations: 1. The threaded configuration on a pipeline stage. Is this really a configuration option or a characteristic of the stage itself. What I mean is - using this configuration, it is possible to make a potentially unthread safe stage run threaded. What I propose is that those threads that can be run threadsafe implement the org.apache.avalon.framework.thread.ThreadSafe interface. In the process results method, we then check instanceof and serialize if necessary. 2. maxThreads. Now this is definitely a configuration option for a pipeline, but for a particular stage? I dont know. What I propose is that the pipeline stage factory checks if this pipeline is threaded (at a pipeline level) and then sets up a ThreadPool (see the feeder threadpool). In fact it might interesting if we look at how we abstract out the threading from the pipelinestagefactory altogether and then we can implement two strategies - basically a SynchronousPipelineProcessor and an AsynchronousPipelineProcessor. Then based on whether we can run threaded or not, we transfer control to one or the other. Please see the diagram. What do you think?? regards, Bruce. |