Home Online Manual
Top
Back: sum
Forward: primecoeffs
FastBack: compregb_lib
FastForward: grobcov_lib
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.3.16 watchdog

Procedure from library general.lib (see general_lib).

Return:
Result of cmd, if the result can be computed in i seconds. Otherwise the computation is interrupted after i seconds, the string "Killed" is returned and the global variable 'watchdog_interrupt' is defined.

Note:
* the current basering should not be watchdog_rneu, since watchdog_rneu will be killed
* if there are variable names of the structure x(i) all polynomials have to be put into eval(...) in order to be interpreted correctly
* a second Singular process is started by this procedure

Example:
 
LIB "general.lib";
proc sleep(int s) {return(system("sh","sleep "+string(s)));}
watchdog(1,"sleep(5)");
==> Killed
watchdog(10,"sleep(5)");
==> 0