What is a “tight loop”?

前端 未结 8 673
说谎
说谎 2020-12-01 06:56

I\'ve heard that phrase a lot. What does it mean?

An example would help.

相关标签:
8条回答
  • 2020-12-01 07:52

    From Wiktionary:

    1. (computing) In assembly languages, a loop which contains few instructions and iterates many times.
    2. (computing) Such a loop which heavily uses I/O or processing resources, failing to adequately share them with other programs running in the operating system.

    For case 1 it is probably like

    for (unsigned int i = 0; i < 0xffffffff; ++ i) {}
    
    0 讨论(0)
  • 2020-12-01 07:52

    According to Webster's dictionary, "A loop of code that executes without releasing any resources to other programs or the operating system."

    http://www.websters-online-dictionary.org/ti/tight+loop.html

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