| 176 |
|
static int r_recv_first = RAYQLEN; /* position of first unreported ray */ |
| 177 |
|
static int r_recv_next = RAYQLEN; /* next received ray placement */ |
| 178 |
|
|
| 179 |
+ |
static int samplestep = 1; /* sample step size */ |
| 180 |
+ |
|
| 181 |
|
#define sendq_full() (r_send_next >= RAYQLEN) |
| 182 |
|
|
| 183 |
|
static int ray_pflush(void); |
| 430 |
|
r_queue[i].clipset = NULL; |
| 431 |
|
r_queue[i].slights = NULL; |
| 432 |
|
r_queue[i].rlvl = 0; |
| 433 |
< |
samplendx++; |
| 433 |
> |
samplendx += samplestep; |
| 434 |
|
rayclear(&r_queue[i]); |
| 435 |
|
rayvalue(&r_queue[i]); |
| 436 |
|
} |
| 464 |
|
strcpy(shm_boundary, "SHM_BOUNDARY"); |
| 465 |
|
} |
| 466 |
|
fflush(NULL); /* clear pending output */ |
| 467 |
+ |
samplestep = ray_pnprocs + nadd; |
| 468 |
|
while (nadd--) { /* fork each new process */ |
| 469 |
|
int p0[2], p1[2]; |
| 470 |
|
if (pipe(p0) < 0 || pipe(p1) < 0) |
| 483 |
|
if (r_proc[ray_pnprocs].pid < 0) |
| 484 |
|
error(SYSTEM, "cannot fork child process"); |
| 485 |
|
close(p1[0]); close(p0[1]); |
| 486 |
+ |
if (rand_samp) /* decorrelate random sequence */ |
| 487 |
+ |
srandom(random()); |
| 488 |
+ |
else |
| 489 |
+ |
samplendx++; |
| 490 |
|
/* |
| 491 |
|
* Close write stream on exec to avoid multiprocessing deadlock. |
| 492 |
|
* No use in read stream without it, so set flag there as well. |