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) cpus=strat->
Ll;
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 {
249 {
250 int ind=queue->dequeue();
251 if (ind== -1)
252 {
254 rqueue->enqueue(getpid());
255 _exit(0);
256 }
257 int red_result=1;
258
263 {
264
268
272 }
273 if ((P.p ==
NULL) && (P.t_p ==
NULL))
274 {
275 red_result = 0;
276 }
277 else
278 {
279
281 P.GetP();
283 if (
p==
NULL) red_result=0;
284 #ifdef KDEBUG
285 else
286 {
288 {
290 }
291 }
292 #endif
293 }
294 if (red_result!=0)
295 {
297 rqueue->enqueue(0);
298 rqueue->enqueue(getpid());
299 _exit(0);
300 }
301 }
302
303 rqueue->enqueue(getpid());
304 _exit(0);
305 }
306 else
307 {
309
310
311
313 int remaining_children=cpus;
314 while(remaining_children>0)
315 {
316 res=rqueue->dequeue();
318 {
320 if (si_waitpid(
res,
NULL,WNOHANG)==0)
321 {
323 {
324 struct timespec t;
326
327 t.tv_sec=10;
328 t.tv_nsec=0;
330
331 if (si_waitpid(
res,
NULL,WNOHANG) ==0)
332 {
334 t.tv_sec=10;
335 t.tv_nsec=0;
338 }
339 }
340 }
341 remaining_children--;
342 }
344 {
347
348 int dummy;
349 do
350 {
351 dummy=queue->dequeue();
352 } while (dummy>=0);
353 }
354 }
355
357 rqueue.free();
359 return all_okay;
360 }
361#else
363#endif
364}
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)
static void * feOptValue(feOptIndex opt)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
BOOLEAN kVerify1(ideal F, ideal Q)
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()