[Edu-sig] Re: while 1: pass

Lloyd Hugh Allen lha2@columbia.edu
Sat, 09 Jun 2001 03:18:56 -0400


Of course, we would also have to watch for the infamous

while 2: pass

If I'm not mistaken, the halting problem suggests that it's impossible
to watch for every infinite loop. We could sacrifice some performance by
only allowing n iterations of any particular control structure (or x
amount of time), but that would kill many prime #, and fibonacci and
other series algorithms.

It would not sacrifice hello world.

Alternatively, perhaps each user gets a cycle in turn, in which case a
user running an infinite loop would only affect everyone else to the
same degree that a user running some other very long program would, if
that makes sense, if it applies. I believe in {li,u}nix terms it means
that each person gets her/his own process running at nice 10 or
something.