Re: Why INFINITE loop in a thread occupy so much CPU time??
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 15 Nov 2007 21:49:47 -0500
Perhaps because you asked it to? If you write a computation that consumes all the CPU, it
is going to, guess what, consume all the CPU! And that's what you've written! So
presumably you WANT to consume 100% of the available CPU time.
I have no idea what while(1) means anyway. while(TRUE) makes sense; while(true) makes
sense. What's an integer got to do with it?
joe
On Wed, 14 Nov 2007 22:16:44 -0800 (PST), lostlander <lostlander.tom@xxxxxxxxx> wrote:
I've got a thread:Joseph M. Newcomer [MVP]
threadFunc(LPVOID pdata)
{
while(1)......
}
why it takes so much cpu time on windows??
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: Why INFINITE loop in a thread occupy so much CPU time??
- From: David Wilkinson
- Re: Why INFINITE loop in a thread occupy so much CPU time??
- References:
- Why INFINITE loop in a thread occupy so much CPU time??
- From: lostlander
- Why INFINITE loop in a thread occupy so much CPU time??
- Prev by Date: Re: Multilanguage support for CEdit
- Next by Date: Re: Multilanguage support for CEdit
- Previous by thread: Re: Why INFINITE loop in a thread occupy so much CPU time??
- Next by thread: Re: Why INFINITE loop in a thread occupy so much CPU time??
- Index(es):
Relevant Pages
|