143{
144#ifdef HAVE_VSPACE
154
156
158
162
166
172
179
180
182 {
183 for(
int i=1;
i<=strat->
sl;
i++)
184 {
186 }
187 }
188 else
189 {
190 for(
int i=1;
i<=strat->
sl;
i++)
191 {
193 }
194 }
197 {
198 for(
int i=strat->
Ll;
i>=0;
i--)
199 {
201 {
202
203
204
205
208 }
209 }
210 }
212
217
218 if (cpus>strat->
Ll+1) cpus=strat->
Ll+1;
219
220 int parent_pid=getpid();
223
226 for(
int i=strat->
Ll;
i>=0;
i--)
227 {
229 }
230 for(
int i=cpus*2;
i>=0;
i--)
231 {
232 queue->enqueue(-1);
233 }
234 int pid;
235 for (
int i=0;
i<cpus;
i++)
236 {
238 if (pid==0) break;
239 }
240
241
242
243 if (parent_pid!=getpid())
244 {
250 {
251 int ind=queue->dequeue();
252 if (ind== -1)
253 {
255 rqueue->enqueue(getpid());
256 _exit(0);
257 }
258 int red_result=1;
259
264 {
265
269
273 }
274 if ((P.p ==
NULL) && (P.t_p ==
NULL))
275 {
276 red_result = 0;
277 }
278 else
279 {
280
282 P.GetP();
284 if (
p==
NULL) red_result=0;
285 #ifdef KDEBUG
286 else
287 {
289 {
291 }
292 }
293 #endif
294 }
295 if (red_result!=0)
296 {
298 rqueue->enqueue(0);
299 rqueue->enqueue(getpid());
300 _exit(0);
301 }
302 }
303
304 rqueue->enqueue(getpid());
305 _exit(0);
306 }
307 else
308 {
310
311
312
314 int remaining_children=cpus;
315 while(remaining_children>0)
316 {
317 res=rqueue->dequeue();
319 {
321 if (si_waitpid(
res,
NULL,WNOHANG)==0)
322 {
324 {
325 struct timespec t;
327
328 t.tv_sec=10;
329 t.tv_nsec=0;
331
332 if (si_waitpid(
res,
NULL,WNOHANG) ==0)
333 {
335 t.tv_sec=10;
336 t.tv_nsec=0;
339 }
340 }
341 }
342 remaining_children--;
343 }
345 {
348
349 int dummy;
350 do
351 {
352 dummy=queue->dequeue();
353 } while (dummy>=0);
354 }
355 }
356
358 rqueue.free();
360 return all_okay;
361 }
362#else
364#endif
365}
si_hdl_typ si_set_signal(int sig, si_hdl_typ signal_handler)
meta function for binding a signal to an handler
void sig_term_hdl_child(int)
const char * feSetOptValue(feOptIndex opt, char *optarg)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void rem(unsigned long *a, unsigned long *q, unsigned long p, int °a, int degq)
static const int MAX_PROCESS
static void vmem_deinit()
static Status vmem_init()
void singular_close_links()