Bug 30422 - [Patch] Mutual Exclusion Tasks
Summary: [Patch] Mutual Exclusion Tasks
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.2
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2004-07-31 04:07 UTC by David Kavanagh
Modified: 2009-07-31 05:37 UTC (History)
0 users



Attachments
This is the complete source for the <Wait> task (3.73 KB, text/plain)
2004-07-31 04:15 UTC, David Kavanagh
Details
This is the complete source for the <Notify> task (2.38 KB, text/plain)
2004-07-31 04:16 UTC, David Kavanagh
Details
This is a sample build file that test the wait/notify tasks (2.06 KB, text/plain)
2004-07-31 04:17 UTC, David Kavanagh
Details
This is a jar that contains the wait/notify tasks. It can be put in ant/lib to test the tasks (3.42 KB, application/octet-stream)
2004-07-31 04:18 UTC, David Kavanagh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kavanagh 2004-07-31 04:07:50 UTC
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, 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.

I have a test build file and the working tasks if anyone wants to see and play
around.
Comment 1 David Kavanagh 2004-07-31 04:15:46 UTC
Created attachment 12287 [details]
This is the complete source for the <Wait> task
Comment 2 David Kavanagh 2004-07-31 04:16:17 UTC
Created attachment 12288 [details]
This is the complete source for the <Notify> task
Comment 3 David Kavanagh 2004-07-31 04:17:02 UTC
Created attachment 12289 [details]
This is a sample build file that test the wait/notify tasks
Comment 4 David Kavanagh 2004-07-31 04:18:14 UTC
Created attachment 12290 [details]
This is a jar that contains the wait/notify tasks. It can be put in ant/lib to test the tasks