Lably
Skip to content

Infinite loop

Programming idiom

  • 11 min read
  • 8 chapters

Related on Lably

Through Computer programming, Computer program and Control flow

There is no general algorithm to determine whether a computer program contains an infinite loop or not; this is the halting problem.

Overview

An infinite loop is a sequence of instructions in a computer program which loops endlessly, either due to the loop having no terminating condition, having one that can never be met, or one that causes the loop to start over. In older operating systems with cooperative multitasking, infinite loops normally caused the entire system to become unresponsive. With the now-prevalent preemptive multitasking model, infinite loops usually cause the program to consume all available processor time, but can usually be terminated by a user. Busy wait loops are also sometimes called "infinite loops". Infinite loops are one possible cause for a computer hanging or freezing; others include thrashing, deadlock, and access violations.

Sign in to keep reading

7 more chapters are free with a Lably account.

More in Computing and communication