165 |
|
static int runcom(char *cs); |
166 |
|
static int rmfile(char *fn); |
167 |
|
static int mvfile(char *fold, char *fnew); |
168 |
< |
static int next_process(void); |
168 |
> |
static int next_process(int reserve); |
169 |
|
static void wait_process(int all); |
170 |
|
static void finish_process(void); |
171 |
|
static void badvalue(int vc); |
751 |
|
op = addarg(op, "-ds .4"); |
752 |
|
else |
753 |
|
op = addarg(op, "-ds 0"); |
754 |
< |
op = addarg(op, "-dt .2 -dc .25 -dr 0 -sj 0 -st .5"); |
754 |
> |
op = addarg(op, "-dt .2 -dc .25 -dr 0 -ss 0 -st .5"); |
755 |
|
if (vdef(AMBFILE)) { |
756 |
|
sprintf(op, " -af %s", vval(AMBFILE)); |
757 |
|
op += strlen(op); |
826 |
|
op = addarg(op, "-ds .2 -dj .9"); |
827 |
|
else |
828 |
|
op = addarg(op, "-ds .3"); |
829 |
< |
op = addarg(op, "-dt .1 -dc .5 -dr 1 -sj .7 -st .1"); |
829 |
> |
op = addarg(op, "-dt .1 -dc .5 -dr 1 -ss 1 -st .1"); |
830 |
|
if ( (overture = vint(INDIRECT)) ) { |
831 |
|
sprintf(op, " -ab %d", overture); |
832 |
|
op += strlen(op); |
904 |
|
op = addarg(op, "-ds .1 -dj .9"); |
905 |
|
else |
906 |
|
op = addarg(op, "-ds .2"); |
907 |
< |
op = addarg(op, "-dt .05 -dc .75 -dr 3 -sj 1 -st .01"); |
907 |
> |
op = addarg(op, "-dt .05 -dc .75 -dr 3 -ss 50 -st .01"); |
908 |
|
sprintf(op, " -ab %d", overture=vint(INDIRECT)+1); |
909 |
|
op += strlen(op); |
910 |
|
if (vdef(AMBFILE)) { |
1371 |
|
fprintf(fp, "%d %d\n", xdiv, ydiv); |
1372 |
|
fclose(fp); |
1373 |
|
} |
1374 |
< |
} else if (next_process()) { |
1374 |
> |
} else if (next_process(0)) { |
1375 |
|
if (pfile != NULL) |
1376 |
|
sleep(10); |
1377 |
|
continue; |
1384 |
|
sprintf(combuf, "%s -R %s %s%s %s %s%s%s -o %s %s", |
1385 |
|
c_rpiece, sfile, rppopt, rep, vw, |
1386 |
|
res, opts, po, rawfile, oct1name); |
1387 |
< |
while (children_running < nprocs-1 && |
1388 |
< |
next_process()) { |
1387 |
> |
while (next_process(1)) { |
1388 |
|
sleep(10); |
1389 |
|
combuf[strlen(c_rpiece)+2] = 'F'; |
1390 |
|
} |
1399 |
|
"%s%s %s%s -x 64 -y 64 -ps 1 %s > %s", |
1400 |
|
c_rpict, rep, vw, opts, |
1401 |
|
oct1name, overfile); |
1402 |
+ |
if (do_rpiece) |
1403 |
+ |
while (next_process(1)) |
1404 |
+ |
sleep(5); |
1405 |
|
if (runcom(combuf)) { |
1406 |
|
fprintf(stderr, |
1407 |
|
"%s: error in overture for view %s\n", |
1408 |
|
progname, vs); |
1409 |
|
quit(1); |
1410 |
|
} |
1411 |
+ |
if (do_rpiece) { |
1412 |
+ |
finish_process(); |
1413 |
+ |
wait_process(1); |
1414 |
+ |
} |
1415 |
|
#ifndef NULL_DEVICE |
1416 |
|
rmfile(overfile); |
1417 |
|
#endif |
1420 |
|
sprintf(combuf, "%s -F %s %s%s %s %s%s%s -o %s %s", |
1421 |
|
c_rpiece, sfile, rppopt, rep, vw, |
1422 |
|
res, opts, po, rawfile, oct1name); |
1423 |
< |
while (children_running < nprocs-1 && |
1418 |
< |
next_process()) |
1423 |
> |
while (next_process(1)) |
1424 |
|
sleep(10); |
1425 |
|
} else { |
1426 |
|
sprintf(combuf, "%s%s %s %s%s%s%s %s > %s", |
1551 |
|
|
1552 |
|
#ifdef RHAS_FORK_EXEC |
1553 |
|
static int |
1554 |
< |
next_process(void) /* fork the next process (max. nprocs) */ |
1554 |
> |
next_process(int reserve) /* fork the next process */ |
1555 |
|
{ |
1556 |
|
RT_PID child_pid; |
1557 |
|
|
1562 |
|
progname); |
1563 |
|
quit(1); |
1564 |
|
} |
1565 |
+ |
if (reserve > 0 && children_running >= nprocs-reserve) |
1566 |
+ |
return(0); /* caller holding back process(es) */ |
1567 |
|
if (children_running >= nprocs) |
1568 |
|
wait_process(0); /* wait for someone to finish */ |
1569 |
|
fflush(NULL); /* flush output */ |
1611 |
|
} |
1612 |
|
#else /* ! RHAS_FORK_EXEC */ |
1613 |
|
static int |
1614 |
< |
next_process(void) |
1614 |
> |
next_process(int reserve) |
1615 |
|
{ |
1616 |
|
return(0); /* cannot start new process */ |
1617 |
|
} |