Tuesday, July 28, 2009

C & C++ is using 100% CPU?

When I'm running C or C++ on my Windows XP; and hardware is Intel Pentium 3; 724 mhz Processor with 128 RAM. It is using the CPU 100% from time of launching till end. But in Core2Duo 1.6 ghz Processor %26amp; 1 GB Ram with the same XP OS it is using 10 to 20% of CPU. Can any one help me Plsss pls pls. and can tell me what will happen if I use it on Windows 98, or ME on the old CPU.

C %26amp; C++ is using 100% CPU?
I assume you're probably compiling a C/C++ program when the CPU goes 100%? That's always a CPU intensive task, so that's normal. The compiled program could also be running into an infinite loop (completely different problem).





Why are you considering regressing to an older OS? I would not recommend doing that, as 98 and ME were extremely crappy OS's.





If you do so anyway, the best case scenario that you may encounter is that compilation time *could* be slightly faster due to a slimmer OS. 128MB are not a lot for Windows XP, who was designed with 256/512 MB in mind, but are decent for a Windows 98/ME installation.





On the other side, XP is a much better OS and it could very well perform better than 98 or ME as far as compilation times. Also, and most importantly, newer releases of your compiler might become unsupported for such old OS's (98 and ME).





If the 100% time is about your C++ program performing weirdly, that's not something you fix by changing OS's.





So, overall, if you can, upgrade the memory to 256 MB or more. Performance with XP will increase. Downgrading to 98/ME is something you will regret.
Reply:C %26amp; C++ are the languages not apps and u'v'nt included the name of apps on which u r working. So i'm assuming u r talking abt TurboC/C++.





There could be some problems like infinite loop, deadlock situation etc. Check for your code and if it not helps then read further.





First application not uses threading, or if it uses then the Pentium III u've not supports. means ur older does'nt supports Hyper Threading Technology. HT is responsible to minimize the pressure on single thread. without it all thread optimization function are'nt supported by processor. That's why each one is taking its maximum processing memory no wait(), no suspend() etc.





second u've the least memory 128MB it also much responsible for high processor usage. How? let me explain..


Actually processor works like moving in circle. Circle has a point where Cache%26lt;%26lt;RAM exists with data. processor takes a circular move an when reaches to this point asks for next data goes to processing then it comes next for other data. Its called Processor cycle. In case of low %26amp; slow memory, it always become full with data processor asking or it takes time to catch data from hard disk which is already busy with previous tasks. In this case when processor comes to Data entry point where Cache gives data to processor, cache shows it has no data(empty hand) because cache gets it data from RAM and RAM from HDD. this situation sends processor empty hand on work. It increases processor cycle, its load on each thread.





Core2Duo has something different, it has completely redesigned memory controller, processor design, cache design. And u r saying 1GB RAM with at least 800Mhz FSB or more. Core2Duo core works seperately on different data. It means when one core busy in some processing, the second core starts working with next data on line. And High RAM fulfills this demand, 'coz when higher ram with high speed meets with High speed HDD it results in quicker data transmission to processor or vice-versa.





Third thing is i think u r using 16 bit version of C/C++ app. Which also very responsible for increasing number of cycles.





I suggest u to use 32bit version, and UPDATE the motherboard.





Good Bye n


Have a nice day.
Reply:What do you mean C and C++ is using 100% cpu...those are programming languages, not programs...be more specific. Sounds like an infinite loop error...or memory leak of some kind


No comments:

Post a Comment