ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: executing task for each file in file set
Date Wed, 13 Jun 2001 12:05:40 GMT
> From: Stefan Bodewig []
> Peter Vogel <> wrote:
> > Except that "parallel" in the sense of execOn simply says that it's
> > ok to provide the whole fileset to the command at once, rather than
> > running the command for each file.
> Or "apply the command to the whole set instead of each member in some
> arbitrary iteration sequence".

I think one of our worst decitions was to use "parallel" for the name of
that attribute. It was a very bad choice of terms, and confusing to say the

> > The same thing could be achieved if there were a way to get a string
> > representation of a fileset
> We will have one in Ant2 .
> But you could only achieve the same as execon does if this string
> representation is a space delimited list of absolute pathnames - not
> the only reasonable choice for FileSet.toString().

I think this is the wrong approach because it puts too much dependency on
surface syntax which can be OS dependant or what have you. A more better
approach on my opinion would be to require the replaced attribute to be an
<element> of some sort, that would mean that a "allatonce" foreach will
require the argument be substituted to be define as an <element> which can
be instantiated multiple times. That would leave the decision of how to
combine the set of arguments toguether to the <task>, which is the only one
that needs to know this.

> > I agree though, it would be interesting to have a "true" parallel
> > attribute,
> Yes it would - but it would be quite dangerous if the tasks nested
> into foreach (or whatever) have not been designed to be thread save.

We could have a marker interface, that users can implement to indicate the
task is parallelizable:

	public interface Parallelizable {};

If the task does not implement the interface, then sequential execution is
enforzed. One could think of having methids on theis interface that allow
you different degrees of parallelism.

Just thoughts,

Jose Alberto

> Stefan

View raw message