| 11 |
|
#include "otypes.h" |
| 12 |
|
#include "platform.h" |
| 13 |
|
|
| 14 |
+ |
char *shm_boundary = NULL; /* boundary of shared memory */ |
| 15 |
+ |
|
| 16 |
|
CUBE thescene; /* our scene */ |
| 17 |
|
OBJECT nsceneobjs; /* number of objects in our scene */ |
| 18 |
|
|
| 224 |
|
if (nproc > MAXPROCESS) |
| 225 |
|
sprintf(errmsg, "too many processes requested -- reducing to %d", |
| 226 |
|
nproc = MAXPROCESS); |
| 227 |
< |
|
| 227 |
> |
if (nproc > 1) { |
| 228 |
> |
preload_objs(); /* preload auxiliary data */ |
| 229 |
> |
/* set shared memory boundary */ |
| 230 |
> |
shm_boundary = strcpy((char *)malloc(16), "SHM_BOUNDARY"); |
| 231 |
> |
} |
| 232 |
|
if ((nproc > 1) & (accumulate <= 0)) |
| 233 |
< |
zero_record(0); /* prime our queue to accumulate */ |
| 233 |
> |
put_zero_record(0); /* prime our queue to accumulate */ |
| 234 |
|
|
| 235 |
|
if (recover) { /* recover previous output? */ |
| 236 |
|
if (accumulate <= 0) { |
| 237 |
|
reload_output(); |
| 238 |
< |
if ((nproc > 1) & (accumulate <= 0)) |
| 238 |
> |
if (nproc > 1) |
| 239 |
|
queue_modifiers(); |
| 240 |
|
} else |
| 241 |
|
recover_output(); |
| 362 |
|
static int ignore_warning_given = 0; |
| 363 |
|
FVECT orig, direc; |
| 364 |
|
double d; |
| 365 |
< |
/* initialize & fork */ |
| 365 |
> |
/* initialize (& fork more of us) */ |
| 366 |
|
rcinit(); |
| 367 |
|
/* load rays from stdin & process */ |
| 368 |
|
#ifdef getc_unlocked |
| 369 |
< |
flockfile(stdin); /* avoid lock/unlock overhead */ |
| 369 |
> |
flockfile(stdin); /* avoid mutex overhead */ |
| 370 |
|
#endif |
| 371 |
|
while (getvec(orig) == 0 && getvec(direc) == 0) { |
| 372 |
|
d = normalize(direc); |