|
7.4. Multithreading TasksThe parallel task can contain other Ant tasks and execute each nested task in its own thread. While the tasks within the parallel task are being run, the main thread will be blocked waiting for all the child threads to complete. This task is useful to speed up build-file processing and to launch external tasks that may depend on each other; you may want to launch a server and run tests on build output, for example. The attributes of this task appear in Table 7-5.
The parallel task supports a daemons nested element, which is a list of tasks which are to be run in parallel daemon threads. The parallel task will not wait for these tasks to complete. Because they are daemon threads, however, they will not prevent Ant from completing the task. The parallel task may be combined with the sequential task to define sequences of tasks to be executed on each thread inside the parallel task; for an example using parallel and sequential, see the next topic. |
|