ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Chaddock" <robin.chadd...@iplay.com>
Subject Re: AW: extended parallelism
Date Tue, 18 Dec 2007 11:50:41 GMT

Yeah,
I think Ant needs to clean up the definition of the depends attribute.

The current definition for 'depends' leads to 2 kinds of dependencies, taking the example
below :-

<target name="a" depends="b,c"/>

1) a depends upon b & c.

This is an explicit dependency, and is persistent for the life-time of the Ant script - it
is impossible for b or c to execute before a, regardless of which targets in the build script
you call.

HOWEVER, due to this ordering rule, the above example also has an additional consequence.

2) b implicitly depends upon c *UNLESS* c explicitly depends upon b.

This implicit dependency is local to only this target definition.

If a different target within the build script were invoked, it could be possible for c to
execute before b.
Extending the above example :-

<target name="a" depends="b,c"/>
<target name="a2" depends="c, b"/>

We now have 2 targets that both have explicit dependencies upon c & b, but we also have
implicit dependencies that conflict.
Obviously if both targets 'a' & 'a2' can execute successfully, then there is infact NO
dependency between b & c (and consequently they should be eligable for parallel execution)


Eliminating the ordering rule to completely get rid of implicit dependencies is fundamental
to adding support for parallel target execution. (without adding additional complication to
the depends syntax)



  ----- Original Message ----- 
  From: Klaus Malorny 
  To: Ant Users List 
  Sent: Tuesday, December 18, 2007 11:08 AM
  Subject: Re: AW: extended parallelism


  Jan.Materne@rzf.fin-nrw.de wrote:
  >> Isn't this the default behaviour anyway?
  > 
  > No - there is no multithreading by default.
  > That's why I write the ParallelExecutor.
  > 
  > 
  >> <target name="a" depends="b,c,d"/>
  >> If such a dependency did exist, it should be incorporated in 
  >> the depends attribute of the 'b' & 'c' target declarations.
  > 
  > Thats the meaning - unordered list.
  > 
  > 
  >> Assuming in the example above that targets b, c & d have no 
  >> dependencies of their own, they should be eligable for 
  >> parallel execution automatically without any need for 
  >> additions to the syntax.
  > 
  > Thats the ParallelExecutor implementation ;)
  > 
  >

  Hmm, interesting view. I was under the impression that there is an implicit 
  order of the targets listed in the "depends" attribute. Two sentences in [1] 
  suggest the same:

        [...]

        Ant tries to execute the targets in the depends attribute
        in the order they appear (from left to right)

        [...]

        It is a good practice to place your tstamp tasks in
        a so-called initialization target, on which all other
        targets depend. Make sure that target is always the
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
        first one in the depends list of the other targets.
        ^^^^^^^^^
        In this manual, most initialization targets have
        the name "init".

        [...]

  [1] http://ant.apache.org/manual/using.html#targets

  Klaus



  ---------------------------------------------------------------------
  To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
  For additional commands, e-mail: user-help@ant.apache.org


________________________________________________________________________
E-mail is an informal method of communication and may be subject to data corruption, interception
and unauthorised amendment for which I-play, a trading name of Digital Bridges Ltd will accept
no liability. Therefore, it will normally be inappropriate to rely on information contained
on e-mail without obtaining written confirmation.

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.

(C) 2005. I-play is a trademark and trading name of Digital Bridges Limited. All Rights Reserved.
________________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message