You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by William Uther <wi...@cs.cmu.edu> on 2000/03/01 22:48:33 UTC

Threaded Ant?

-- costin@eng.sun.com wrote:

> Problems with "variables"
> 
> - order of execution. You may run 2 targets in paralel (
> it's a reasonable thing - if you have a multiporcessor for example). In
> this case you need complex rules for variables. 

Fair enough.  With threads this would not be hard to implement.  I assume
this would mean that the current ordering constraint on dependancies would
be removed:

Re: Threaded Ant?

Posted by Stefano Mazzocchi <st...@apache.org>.
Michael Smith wrote:
> 
> William Uther wrote:
> > Hmm.  I must admit to being confused as to why the ordering constraint is
> > there.  If you have a strict ordering constraint then you could enforce it
> > with a dependancy.  No target would be executed before the targets it
> > depends upon.  I would prefer to default to parallel.
> 
> I agree that if you have an ordering constraint you would use an explicit
> dependency.  But I am still left wondering: Why do you want/need to run
> things in parallel right now?  What do you gain?
> 
> Better usage of a multi-processor system?  In that case, why not run Ant in
> two different shells with two different build files (or one build file and
> two different targets).  That'll also make your life easier when a build
> fails -- you won't have to figure out which log messages went with which
> task.  It also leaves Ant "simple" and easy to use.
> 
> Making Ant multithreaded seems like it's increasing the complexity too much
> too fast.  At this point,  I see no compelling reason to add in something
> like this. How about we solve one problem at a time...  Seems like there are
> three or four different threads going on right now, and they all overlap to
> some degree.

+1

Please, since Ant is a tool and all of us have other things to
concentrate on, let's focus on getting useful things done before
spitting new proposals each and every day.

The bandwidth taken by the list has grown a lot... but I wonder about
the signal/noise ratio.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: Threaded Ant?

Posted by Michael Smith <mi...@sneakerlabs.com>.
William Uther wrote:
> Hmm.  I must admit to being confused as to why the ordering constraint is
> there.  If you have a strict ordering constraint then you could enforce it
> with a dependancy.  No target would be executed before the targets it
> depends upon.  I would prefer to default to parallel.

I agree that if you have an ordering constraint you would use an explicit
dependency.  But I am still left wondering: Why do you want/need to run
things in parallel right now?  What do you gain?

Better usage of a multi-processor system?  In that case, why not run Ant in
two different shells with two different build files (or one build file and
two different targets).  That'll also make your life easier when a build
fails -- you won't have to figure out which log messages went with which
task.  It also leaves Ant "simple" and easy to use.  

Making Ant multithreaded seems like it's increasing the complexity too much
too fast.  At this point,  I see no compelling reason to add in something
like this. How about we solve one problem at a time...  Seems like there are
three or four different threads going on right now, and they all overlap to
some degree.  

Regards,
michael
-- 
michael@sneakerlabs.com
http://www.sneakerlabs.com

Re: Threaded Ant?

Posted by William Uther <wi...@cs.cmu.edu>.
Hi,
  If this is going to take any real discussion then it should wait till
everything else is sorted out.  I was hoping for a quick ok.

--Jose Alberto Fernandez <jo...@us.oracle.com> wrote:
> William Uther wrote:
>> -- costin@eng.sun.com wrote:
>>> Problems with "variables"
>>> 
>>> - order of execution. You may run 2 targets in paralel (
>>> it's a reasonable thing - if you have a multiporcessor for example). In
>>> this case you need complex rules for variables.
>> 
>> Fair enough.  With threads this would not be hard to implement.  I assume
>> this would mean that the current ordering constraint on dependancies
>> would be removed:
>> 
>> From the Ant docs:
>>> Ant tries to execute the targets in the depends attribute in the order
>>> they appear (from left to right). Keep in mind that it is possible
>>> that a target can get executed earlier when an earlier target depends
>>> on it...
>> 
>> That constraint currently limits Ant to being serial, doesn't it?
> 
> You probably would need to add a property indicating that the target
> dependencies can be executed in parallel, or something like that.

Hmm.  I must admit to being confused as to why the ordering constraint is
there.  If you have a strict ordering constraint then you could enforce it
with a dependancy.  No target would be executed before the targets it
depends upon.  I would prefer to default to parallel.

I should add one exception.  I'd add an extra attribute to the <project>
tag which specifies the maximum number of parallel threads (not sure where
to set the default: 1 or infinite - have to play with it and see how it
works).  That way you you can set the maximum number of threads to reduce
resource contention if that is an issue.

Does anyone have any build files that depend upon this ordering?

\x/ill           :-}


Re: Threaded Ant?

Posted by Jose Alberto Fernandez <jo...@us.oracle.com>.

William Uther wrote:

> -- costin@eng.sun.com wrote:
>
> > Problems with "variables"
> >
> > - order of execution. You may run 2 targets in paralel (
> > it's a reasonable thing - if you have a multiporcessor for example). In
> > this case you need complex rules for variables.
>
> Fair enough.  With threads this would not be hard to implement.  I assume
> this would mean that the current ordering constraint on dependancies would
> be removed:
>
> From the Ant docs:
> > Ant tries to execute the targets in the depends attribute in the order
> > they appear (from left to right). Keep in mind that it is possible that a
> > target can get executed earlier when an earlier target depends on it...
>
> That constraint currently limits Ant to being serial, doesn't it?
>

You probably would need to add a property indicating that the target
dependencies can be executed in parallel, or something like that.

>
> If I were to implement this change, would someone check it in for me?  Or
> would it just be another difference between my Ant and the normal Ant that
> makes merging hard?
>
> later,
>
> \x/ill       :-}

--
  ------------------------------------------------------------------------
 Jose Alberto Fernandez               500 Oracle Parkway, M/S 9op4
 Development Manager                  Redwood Shores, CA 94065
 ORACLE Corp.                         Phone: (650) 506-8830
 Java Products Group                  Fax: (650) 506-7303
 Languages & Obj-Relational Tech      Email: jofernan@us.oracle.com