The same problem appears on native port. It seems to be caused
by execl() which creates a new process instead of replacing the
current process.
http://www.koders.com/c/fidBE86F115AFA6E74AB2C152B94B88C601A2CAEEE1.aspx
#define P_WAIT 1
#define P_NOWAIT 2 /* always generates error */
#define P_OVERLAY 3
int execl(const char *path, const char *argv0, ...)
{
return spawnve(P_OVERLAY, path, &argv0, environ);
}
I think that spawnve with P_WAIT should help, I'll try it with the native port.
Radim
On 4/21/06, Luigi Ponti <lponti@infinito.it> wrote:
Hello,
Maybe unrelated but I remember a similar question on the list.
When I run a ~400 lines bash script to batch process more than just a
couple of files, the script kind of of gets tangled and stops before
processing the last file (it is basically v.in.ascii importing plus
v.rast.idw interpolating, and some Perl scripts), as if some overlapping
between child processes occurred.
I tried with the "wait" bash command which should have fixed it, but it
still occurs. Is it a known issue? Or is it related to the fact that I
am running grass60 on cygwin?
Any hints to make grass batch processing more reliable will be appreciated.
Thanks,
Luigi
It seems that execlp() and _spawnlp ( _P_OVERLAY,..) realy does not
wait for the end of the new process (the current process is not replaced?)
_spawnlp ( _P_WAIT, ...) seems to work , I have put iit into CVS,
please test with the next build.
Radim
On 4/21/06, Radim Blazek <radim.blazek@gmail.com> wrote:
The same problem appears on native port. It seems to be caused
by execl() which creates a new process instead of replacing the
current process.
http://www.koders.com/c/fidBE86F115AFA6E74AB2C152B94B88C601A2CAEEE1.aspx
#define P_WAIT 1
#define P_NOWAIT 2 /* always generates error */
#define P_OVERLAY 3
int execl(const char *path, const char *argv0, ...)
{
return spawnve(P_OVERLAY, path, &argv0, environ);
}
I think that spawnve with P_WAIT should help, I'll try it with the native port.
Radim
On 4/21/06, Luigi Ponti <lponti@infinito.it> wrote:
> Hello,
>
> Maybe unrelated but I remember a similar question on the list.
>
> When I run a ~400 lines bash script to batch process more than just a
> couple of files, the script kind of of gets tangled and stops before
> processing the last file (it is basically v.in.ascii importing plus
> v.rast.idw interpolating, and some Perl scripts), as if some overlapping
> between child processes occurred.
>
> I tried with the "wait" bash command which should have fixed it, but it
> still occurs. Is it a known issue? Or is it related to the fact that I
> am running grass60 on cygwin?
>
> Any hints to make grass batch processing more reliable will be appreciated.
>
> Thanks,
>
> Luigi
>
>
Radim Blazek wrote:
It seems that execlp() and _spawnlp ( _P_OVERLAY,..) realy does not
wait for the end of the new process (the current process is not replaced?)
It replaces the calling process in the sense that the calling process
ceases to exist if the call is successful. I suspect what is happening
is that the caller's parent considers the process to have terminated
at that point.
--
Glynn Clements <glynn@gclements.plus.com>
Thanks Radim. Hopefully this will mean that I can get rid of some wait
statements.
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
From: Radim Blazek <radim.blazek@gmail.com>
Date: Thu, 27 Apr 2006 16:53:53 +0200
To: Luigi Ponti <lponti@infinito.it>
Cc: <GRASSLIST@baylor.edu>, "grass5@grass.itc.it" <grass5@grass.itc.it>
Subject: [GRASS5] Re: [GRASSLIST:787] bash scripts don't wait for grass
It seems that execlp() and _spawnlp ( _P_OVERLAY,..) realy does not
wait for the end of the new process (the current process is not replaced?)
_spawnlp ( _P_WAIT, ...) seems to work , I have put iit into CVS,
please test with the next build.
Radim
On 4/21/06, Radim Blazek <radim.blazek@gmail.com> wrote:
The same problem appears on native port. It seems to be caused
by execl() which creates a new process instead of replacing the
current process.
http://www.koders.com/c/fidBE86F115AFA6E74AB2C152B94B88C601A2CAEEE1.aspx
#define P_WAIT 1
#define P_NOWAIT 2 /* always generates error */
#define P_OVERLAY 3
int execl(const char *path, const char *argv0, ...)
{
return spawnve(P_OVERLAY, path, &argv0, environ);
}
I think that spawnve with P_WAIT should help, I'll try it with the native
port.
Radim
On 4/21/06, Luigi Ponti <lponti@infinito.it> wrote:
Hello,
Maybe unrelated but I remember a similar question on the list.
When I run a ~400 lines bash script to batch process more than just a
couple of files, the script kind of of gets tangled and stops before
processing the last file (it is basically v.in.ascii importing plus
v.rast.idw interpolating, and some Perl scripts), as if some overlapping
between child processes occurred.
I tried with the "wait" bash command which should have fixed it, but it
still occurs. Is it a known issue? Or is it related to the fact that I
am running grass60 on cygwin?
Any hints to make grass batch processing more reliable will be appreciated.
Thanks,
Luigi