Re: Looping Choice

Discussion in 'C Programming' started by Martin Ambuhl, Sep 30, 2008.

  1. Lorenzo Villari wrote:
    > In
    > http://fms.komkon.org/EMUL8/HOWTO.html
    > I read:
    > "After initial values are assigned, we start the main loop:


    > for(;;)
    > {


    > Note that this loop can also be implemented as


    > while(CPUIsRunning)
    > {


    > where CPUIsRunning is a boolean variable. This has certain advantages,
    > as you can terminate the loop at any moment by setting CPUIsRunning=0.
    > Unfortunately, checking this variable on every pass takes quite a lot of
    > CPU time,


    That is nonsense.

    > and should be avoided if possible. Also, do not implement this
    > loop as
    >
    > while(1)
    > {
    >
    > because in this case, some compilers will generate code checking
    > whether 1 is true or not. You certainly don't want the compiler to do
    > this unnecessary work on every pass of a loop."


    That is nonsense. It is even sillier than that which came before.

    > I would like to read your opinions on these statements :)


    Try using a reputable source in the future. The claims that you quoted
    are complete bullshit.
    Martin Ambuhl, Sep 30, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian
    Replies:
    6
    Views:
    512
    Terje A. Bergesen
    Oct 9, 2004
  2. Mickey Segal
    Replies:
    0
    Views:
    855
    Mickey Segal
    Feb 2, 2004
  3. miles.jg
    Replies:
    16
    Views:
    854
    Alf P. Steinbach
    Nov 14, 2007
  4. James Kuyper

    Re: Looping Choice

    James Kuyper, Sep 30, 2008, in forum: C Programming
    Replies:
    7
    Views:
    371
    CBFalconer
    Oct 3, 2008
  5. Replies:
    5
    Views:
    262
Loading...

Share This Page