Asad Abbas wrote:
>  
>
> Why the Cpu Usage Boosts to 100% While running this simple Prog?
>
> can this code damage cpu?
> How long will it take to damage a CPU?
>
> I know this contains a infinite loop, but this is simple prog in KB 
> and we run progs and games which are much much larger than this at 
> that cpu doesnt boosts to 100%
> main()
> {
>    
>    while (1)
>    {
>          }
> getche();
> return 0;
> }
> ----------------------------------------------------------
> Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn't mttaer 
> in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is 
> taht frist and lsat ltteer is at the rghit pclae. The rset can be a 
> toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae 
> we do not raed ervey lteter by itslef but the wrod as a wlohe.
>
> [Non-text portions of this message have been removed]
>
> 
For one, games and larger programs don't have empty-bodied loops (for 
the most part). And no, it won't damage the CPU any more than any other 
program will. The CPU is ALWAYS executing code, no matter what. It does 
not "pause" it's execution (even when you "sleep" your program). As for 
why the CPU usage goes up with an empty loop, is because it executes so 
quickly (resulting in more instructions being executed in the same time 
slice).


[Non-text portions of this message have been removed]

Reply via email to