Why use infinite loops?

前端 未结 14 1922
深忆病人
深忆病人 2021-02-08 13:34

Another poster asked about preferred syntax for infinite loops.

A follow-up question: Why do you use infinite loops in your code? I typically see a construct like

相关标签:
14条回答
  • 2021-02-08 14:16

    I used to use them when waiting for multiple threads to complete in c#, but now I use the ThreadPool class.

    0 讨论(0)
  • 2021-02-08 14:17

    Finite state machines. They're not supposed to end until you reach an end state, at which point you break or return.

    0 讨论(0)
提交回复
热议问题