ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: Atomic/Synchronized Task
Date Thu, 24 Jun 2010 21:40:41 GMT

On Jun 24, 2010, at 4:34 PM, Perrier, Nathan wrote:

> No, that's just a wrapper task that executes the subtasks it wraps in
> order.  It is not "thread-safe", which is what I am looking for.
> 
> Basically, what I'm looking for is a locking mechanism for certain tasks
> that can't run in parallel.
> 

Gotcha.  There is a little bit of discussion on dev@ant.apache.org about a parallel target
executor implementation, and a similar effort a few years ago contained some notion of target
exclusivity.  That's not task exclusivity, but it might behoove you to join in the development
effort of the parallel executor (if its author is open to outside participation).  It could
be close enough or lead to something that is.

HTH,
Matt

> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@gmail.com] 
> Sent: Thursday, June 24, 2010 4:24 PM
> To: Ant Users List
> Subject: Re: Atomic/Synchronized Task
> 
> 
> On Jun 24, 2010, at 4:04 PM, Perrier, Nathan wrote:
> 
>> Hello all,
>> 
>> 
>> 
>> I was curious if there exists a means to atomically execute tasks when
>> running targets in parallel.
>> 
> 
> <sequential> ?
> 
> -Matt
> 
>> 
>> 
>> I.E., I would like to do something like the following:
>> 
>> 
>> 
>> <target name="begin">
>> 
>>               <parallel>
>> 
>>                               <antcall target="one"/>
>> 
>>                               <antcall target="two"/>
>> 
>>               </parallel>
>> 
>> </target>
>> 
>> 
>> 
>> <target name="one">
>> 
>> ...
>> 
>>               Do something in parallel
>> 
>> ...
>> 
>>               <synchronized>
>> 
>> ...
>> 
>>                               Do something atomically
>> 
>> ...
>> 
>>               </synchronized>
>> 
>> ...
>> 
>> </target>
>> 
>> 
>> 
>> <target name="two">
>> 
>> ...
>> 
>>               Do something in parallel
>> 
>> ...
>> 
>>               <synchronized>
>> 
>> ...
>> 
>>                               Do something atomically
>> 
>> ...
>> 
>>               </synchronized>
>> 
>> ...
>> 
>> </target>
>> 
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


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


Mime
View raw message