in reply to Re: Do infinite loops ever die?
in thread Do infinite loops ever die?

The sleep command in your example puts this script rather firmly into the "Safe" category: sleeping is the precise method you use when you want something like this NOT to consume CPU resources. The sleep command does precisely what it implies: it sleeps in a very CPU friendly way.

A better test (minus the fork bomb mentioned below) would be:

$__++ while 1;
But even that is bland. Any decent operating system will run unhindered with this executing.

mr.nick ..

Replies are listed 'Best First'.
Re: Re: Re: Do infinite loops ever die?
by Eradicatore (Monk) on Jun 13, 2001 at 06:25 UTC
    My goal though was just to have a "nice" infinite loop, if there is such a thing. "nicer" at the very least. I didn't want to suck resources, but rather just test to see if the process died. I was on FreeBSD/i386.

    Justin Eltoft

    "If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews