ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ernst de Haan <er...@jollem.com>
Subject Re: asynchronous tasks
Date Sat, 17 Jun 2000 15:03:58 GMT
Hi Conor,

What is the advantage of executing tasks asynch ? Perhaps I'm missing
something here, but I'd say they are usually processor-bound, so you will not
get extra speed out of it. And since a Java process is single-process by
design, I assume even a second processor would not be able to speed this up.


Ernst


Conor MacNeill wrote:
> Hi,
> 
> A while back I posted a patch to allow tasks to be run in a separate thread.
> I have made a few other changes now which I would like to run by everyone.
> Whilst I made these changes primarily to support async operation, they do
> affect the normal operation of ant.
> 
> When running multiple threads it is important to distinguish the output of
> separate threads. I have therefore introduced a task name which defaults to
> the task type but which can be set explicitly in the task XML. I have
> created log methods in the Task class which add this task name into log
> messages. These call the appropriate Project.log methods, with the taskname
> as a tag. (Many tasks were doing this anyway). The resulting output would be
> something like
> 
> [mkdir] Created dir: F:\Projects\jakarta\build\ant\classes
> [javac] Compiling 56 source files to F:\Projects\jakarta\build\ant\classes
> [javac] Copying 2 support files to F:\Projects\jakarta\build\ant\classes
> Executing Target: jar
> [jar] Building jar: F:\Projects\jakarta\jakarta-ant\lib\ant.jar
> Executing Target: javadocs
> [mkdir] Created dir: F:\Projects\jakarta\build\ant\javadocs
> [javadoc] Generating Javadoc
> [javadoc err] javadoc: warning - Import not found: netrexx.lang.Rexx -
> ignoring!
> [javadoc] 3 warnings
> Executing Target: dist
> [mkdir] Created dir: F:\Projects\jakarta\dist\ant
> [copydir] Copying 60 files to F:\Projects\jakarta\dist\ant\src
> 
> I am also including two new taskdefs used in multithreaded situations
> <sleep> and <join>. Sleep simply sleeps for some milliseconds and join joins
> all current task threads to the main ant thread.
> 
> The diffs and new classes are attached.
> 
> If no one objects to these changes, I will commit them next week.
> 
> Cheers
> Conor
> 
> 
> 
> --
> Conor MacNeill
> Home: conor@m64.com
> Work: conor@cortexebusiness.com.au
> Web:  www.cortexebusiness.com.au

Mime
View raw message