Hacker News new | ask | show | jobs
by dragonwriter 3318 days ago
> Doesn't any program that processes interactive/network IO require an infinite loop?

No.

I mean, there are lots of common uses of unbounded loops in that domain, but any of them could be replaced with maximum-bounded loops with sufficient large bounds and be unnoticeably different in practice, mostly cutting off (largely pathological) edge cases.

1 comments

It seems that a better solution is to guarantee that each step of such an unbounded loop is bounded, and clearly distinguish these types of processes.

For example, a kernel's scheduler should run indefinitely, but each scheduling step should be bounded. Ideally we would specify the scheduler loop as a non-terminating yet "productive" process.