You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Kavanagh <dk...@gmail.com> on 2004/07/29 14:20:41 UTC

mutex tasks

I'm just curious about how useful other folks would find this.

I've created 2 tasks <Wait> and <Notify>.
The use case is where you have parallel ants running (on some server)
doing builds, but 1 part of the build (in our case, some JFCUnit)
needs to be single threaded. By this I mean that each of the
build/validates that we are doing can run in parallel, with the
exception of the JFCUnit portion due to focus issues.

So, wrap the JFCUnit portion of the validate in the <Wait> <Notify>
tasks. What wait does is create a lock file (a zero length file in a
lock directory), check for other locks, of none exist, it goes
forward. If other locks exist, it removes its lock file and does a
random wait (based on parameters) and tries again. <Notify> simply
removes the lock (file).

I have a test build file and the working tasks if anyone wants to see and play
around.

David

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