ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/docs/manual/CoreTasks parallel.html
Date Thu, 09 Aug 2001 10:48:12 GMT
conor       01/08/09 03:48:12

  Modified:    docs/manual coretasklist.html
  Added:       docs/manual/CoreTasks parallel.html
  Log:
  Description of parallel task
  
  Revision  Changes    Path
  1.17      +1 -0      jakarta-ant/docs/manual/coretasklist.html
  
  Index: coretasklist.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/coretasklist.html,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- coretasklist.html	2001/08/09 05:48:49	1.16
  +++ coretasklist.html	2001/08/09 10:48:12	1.17
  @@ -52,6 +52,7 @@
   <a href="CoreTasks/mail.html">Mail</a><br>
   <a href="CoreTasks/mkdir.html">Mkdir</a><br>
   <a href="CoreTasks/move.html">Move</a><br>
  +<a href="CoreTasks/parallel.html">Parallel</a><br>
   <a href="CoreTasks/patch.html">Patch</a><br>
   <a href="CoreTasks/pathconvert.html">PathConvert</a><br>
   <a href="CoreTasks/property.html">Property</a><br>
  
  
  
  1.1                  jakarta-ant/docs/manual/CoreTasks/parallel.html
  
  Index: parallel.html
  ===================================================================
  <html>
  
  <head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Ant User Manual</title>
  </head>
  
  <body>
  
  <h2>Parallel</h2>
  <h3>Description</h3>
  <p>Parallel is a container task - it can contain other Ant tasks. Each nested
  task within the parallel task will be executed in its own thread. </p>
  
  <p>Parallel tasks have a number of uses in an Ant build file including:
  <ul>
  <li>Taking advantage of available processing resources to reduce build time</li>
  <li>Testing servers, where the server can be run in one thread and the test
  harness is run in another thread.</li>
  </ul>
  
  <p>Care must be taken when using multithreading to ensure the tasks within the
  threads do not interact. For example, two javac compile tasks which write 
  classes into the same destination directory may interact where one tries to
  read a class for depenency information while the other task is writing the 
  class file. Be sure to avoid these types of interactions within a 
  &lt;parallel&gt; task</p>
    
  <p>The parallel task has no attributes and does not support any nested 
  elements apart from Ant tasks. Any valid Ant task may be embedded within a 
  parallel task, including other parallel tasks.</p>
  
  <p>Note that while the tasks within the parallel task are being run, the main 
  thread will be blocked waiting for all the child threads to complete.</p>  
  
  <p>If any of the tasks within the &lt;parallel&gt; task fails, the remaining

  tasks in other threads will continue to run until all threads have completed. 
  In this sitiuation, the parallel task will also fail.</p>
  
  <h3>Examples</h3>
  <pre>
  &lt;parallel&gt;
    &lt;wlrun ...&gt;
    &lt;sequential&gt;
      &lt;sleep seconds=&quot;30&quot;/&gt;
      &lt;junit ...&gt;
      &lt;wlstop/&gt;
    &lt;/sequential&gt;
  &lt;/parallel&gt;
  </pre>
  <p>This example represents a typical pattern for testing a server application. 
  In one thread the server is started (the wlrun task). The other thread consists 
  of a three tasks which are performed in sequence. The sleep task is used to 
  give the server time to come up. Another task which is capabale of validating 
  that the server is available could be used in place of the sleep task. The 
  test harness is then run. Once the tests are complete, the server is stopped 
  (using wlstop in this example), allowing both threads to complete. The 
  parallel task will also complete at this time and the build will then 
  continue.</p>
  
  <pre>
  &lt;parallel&gt;
    &lt;javac ...&gt; &lt;!-- compiler servlet code --&gt;
    &lt;wljspc ...&gt; &lt;!-- precompile JSPs --&gt;
  &lt;/parallel&gt;
  </pre>
  
  <p>This example shows two independent tasks being run to achieve better 
  resource utilization during the build. In this instance, some servlets are being
  compiled in one thead and a set of JSPs is being precompiled in another. As 
  noted above, you need to be careful that the two tasks are independent, both in 
  terms of their dependencies and in terms of their potential interactions in
  Ant's external environment.</p>
  <hr>
  <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  Reserved.</p>
  </body>
  </html>
  
  
  
  

Mime
View raw message