154 |
|
|
155 |
|
extern char *shm_boundary; /* boundary of shared memory */ |
156 |
|
|
157 |
– |
int ray_pfifo = 0; /* maintain ray call order? */ |
157 |
|
int ray_pnprocs = 0; /* number of child processes */ |
158 |
|
int ray_pnidle = 0; /* number of idle children */ |
159 |
|
|
168 |
|
static RAY r_queue[2*RAYQLEN]; /* ray i/o buffer */ |
169 |
|
static int r_send_next; /* next send ray placement */ |
170 |
|
static int r_recv_first; /* position of first unreported ray */ |
171 |
< |
static int r_recv_next; /* next receive ray placement */ |
171 |
> |
static int r_recv_next; /* next received ray placement */ |
172 |
|
|
173 |
|
#define sendq_full() (r_send_next >= RAYQLEN) |
174 |
|
|
176 |
|
static void ray_pchild(int fd_in, int fd_out); |
177 |
|
|
178 |
|
|
179 |
< |
extern void |
179 |
> |
void |
180 |
|
ray_pinit( /* initialize ray-tracing processes */ |
181 |
|
char *otnm, |
182 |
|
int nproc |
229 |
|
} |
230 |
|
|
231 |
|
|
232 |
< |
extern void |
232 |
> |
void |
233 |
|
ray_psend( /* add a ray to our send queue */ |
234 |
|
RAY *r |
235 |
|
) |
244 |
|
} |
245 |
|
|
246 |
|
|
247 |
< |
extern int |
247 |
> |
int |
248 |
|
ray_pqueue( /* queue a ray for computation */ |
249 |
|
RAY *r |
250 |
|
) |
273 |
|
} |
274 |
|
|
275 |
|
|
276 |
< |
extern int |
276 |
> |
int |
277 |
|
ray_presult( /* check for a completed ray */ |
278 |
|
RAY *r, |
279 |
|
int poll |
310 |
|
if (FD_ISSET(r_proc[pn].fd_recv, &readset) || |
311 |
|
FD_ISSET(r_proc[pn].fd_recv, &errset)) |
312 |
|
break; |
313 |
< |
/* call select if we must */ |
313 |
> |
/* call select() if we must */ |
314 |
|
if (pn < 0) { |
315 |
|
FD_ZERO(&readset); FD_ZERO(&errset); n = 0; |
316 |
|
for (pn = ray_pnprocs; pn--; ) { |
370 |
|
} |
371 |
|
|
372 |
|
|
373 |
< |
extern void |
373 |
> |
void |
374 |
|
ray_pdone( /* reap children and free data */ |
375 |
|
int freall |
376 |
|
) |
434 |
|
} |
435 |
|
|
436 |
|
|
437 |
< |
extern void |
437 |
> |
void |
438 |
|
ray_popen( /* open the specified # processes */ |
439 |
|
int nadd |
440 |
|
) |
484 |
|
} |
485 |
|
|
486 |
|
|
487 |
< |
extern void |
487 |
> |
void |
488 |
|
ray_pclose( /* close one or more child processes */ |
489 |
|
int nsub |
490 |
|
) |