High CPU consumption

| Index | Champ Home Page |

Posted by Aegidius on 2007-01-08 13:54 CET

Hello,

In a big application using CHAMP I have an event loop which handles all user input. Even when the program is in "idle" mode waiting for any user input, it consumes almost 100% CPU time, even if I call CP::yield() repeatedly.

The prototype of the program is as follows:

#include <champ.h>

void gmain ()
{
cinit();
cout << "Press any key to quit...";

while (!kbhit())
{
CP::yield();
}
cend();
}

Substituting CP::yield() with CPTimer::delay(10) does not help.

What can I do?

Thanks, Aegidius

Email: (hidden)


Current thread:
High CPU consumption Aegidius 2007-01-08 13:54 CET
Re: High CPU consumption Hans Salvisberg 2007-01-09 08:47 CET
Re: High CPU consumption Aegidius 2007-01-15 21:41 CET
Re: High CPU consumption Hans Salvisberg 2007-01-15 23:46 CET
Re: High CPU consumption Aegidius 2007-01-16 10:42 CET
Re: High CPU consumption Hans Salvisberg 2007-01-16 14:24 CET
Greetings! Nicksasa 2010-02-26 00:35 CET
Web hosting question Liertriarse 2010-03-03 20:21 CET
As seen on Oprah, $6 fast cash for those strugglin StoftoretShew 2010-03-29 03:20 CET
Auto question... edgentienNure 2010-04-11 16:40 CET
looking for the best project of city house 2010 Architekta 2010-05-31 05:59 CET
Are Moderator Here? checkmoderator 2010-06-06 14:56 CET
Are Admin Here? checkdmin 2010-06-12 13:18 CET
Hello Friends!! haiseefat 2010-07-05 21:20 CET
How i just got my free IPhone 4g! SBIGGY 2010-07-24 03:20 CET
Any person have some high quality business card on businesscardonlineki 2010-07-29 04:30 CET
Buy Xenical guttadutt 2010-08-26 03:19 CET
Leder du efter et sted at offentliggøre mine artik GrooRiezete 2010-02-22 13:13 CET

Use this form to post a followup.
Name:
Email: (optional, hidden, replies will be forwarded to this address)
Subject:   (no text)

Message:

Optional Link (uses rel="nofollow" attribute to avoid attracting spammers)
Apparently, the forum spammers don't know what rel="nofollow" does, and because
they continue to feed their trash into the forum, we have to disable the Link feature.
Please do not post any link, or your post will be deleted automatically.
We're sorry for having to take that measure.
URL:
Title:

   



| Index | Champ Home Page |

Copyright © 2010 Salvisberg Software & Consulting. All rights reserved.
Top