4 ms·
Doesn't any program that processes interactive/network IO require an infinite loop? Are those programs not useful?
by avaer 9y ago
Doesn't any program that processes interactive/network IO require an infinite loop?
Are those programs not useful?
- eberkund 9y agoNo, they can use interrupts instead.
- avaer 9y agoI don't understand how that avoids looping. If your program doesn't loop waiting for interrupts, it has terminated. So it won't be getting those interrupts.
- dragonwriter 9y 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.
- mbrock 9y agoIt 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.