You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Murray, Mike" <mb...@ptc.com> on 2008/02/18 22:06:10 UTC
Exec Hangs in Multi-Threaded Parallel
Can anyone tell me why the exec task, whether or not spawned, hangs in
parallel calls? It works fine if I pass -DthreadCount=1. It appears
the higher the threadCount used, the quicker it will hang, since
-DthreadCount=2 works for a while, but threadCount=5 hangs immediately.
This apparently happens when two exec tasks are called simultaneously.
Using a forked java task in similar fashion, hangs the same way. The
parallel calls of BuildModule work fine when the macrodef uses the ant
task.
Thanks, Mike
<parallel threadCount='${threadCount}'>
<BuildModule name='wnc/Cadx' modroot='CadxHtmlUi/Cadx'
assembly='wnc' />
<BuildModule name='wnc/Esi' modroot='wcEsi/Esi' assembly='wnc' />
<BuildModule name='wnc/Explorer'
modroot='Windchill/DevModules/Explorer' assembly='wnc' />
</parallel>
<macrodef name="BuildModule">
<attribute name="assembly" default=""/>
<attribute name="name" default="@{assembly}"/>
<attribute name="modroot"/>
<sequential>
<exec executable="ant" spawn="true" vmlauncher="false">
<arg line="-f ${module_script} ${ant.arguments}
-Dmodroot=${viewroot}/@{modroot <mailto:-Dmodroot=${viewroot}/@{modroot>
} -Dcontext=@{assembly}"/ <mailto:-Dcontext=@{assembly}"/> >
</exec>
Re: Exec Hangs in Multi-Threaded Parallel
Posted by Steve Loughran <st...@apache.org>.
Murray, Mike wrote:
> Can anyone tell me why the exec task, whether or not spawned, hangs in
> parallel calls? It works fine if I pass -DthreadCount=1. It appears
> the higher the threadCount used, the quicker it will hang, since
> -DthreadCount=2 works for a while, but threadCount=5 hangs immediately.
> This apparently happens when two exec tasks are called simultaneously.
> Using a forked java task in similar fashion, hangs the same way. The
> parallel calls of BuildModule work fine when the macrodef uses the ant
> task.
I've not seen this. I wonder if its some kind of race condition/deadlock
in exec or parallel
>
> Thanks, Mike
>
> <parallel threadCount='${threadCount}'>
> <BuildModule name='wnc/Cadx' modroot='CadxHtmlUi/Cadx'
> assembly='wnc' />
> <BuildModule name='wnc/Esi' modroot='wcEsi/Esi' assembly='wnc' />
> <BuildModule name='wnc/Explorer'
> modroot='Windchill/DevModules/Explorer' assembly='wnc' />
> </parallel>
>
> <macrodef name="BuildModule">
> <attribute name="assembly" default=""/>
> <attribute name="name" default="@{assembly}"/>
> <attribute name="modroot"/>
> <sequential>
> <exec executable="ant" spawn="true" vmlauncher="false">
> <arg line="-f ${module_script} ${ant.arguments}
> -Dmodroot=${viewroot}/@{modroot <mailto:-Dmodroot=${viewroot}/@{modroot>
> } -Dcontext=@{assembly}"/ <mailto:-Dcontext=@{assembly}"/> >
> </exec>
>
>
>
--
Steve Loughran http://www.1060.org/blogxter/publish/5
Author: Ant in Action http://antbook.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org