![]() |
| | #1 |
| Registered User Join Date: Aug 2003
Posts: 288
| CPU Usage so high Is this normal? But i was trying this with other programs such as Windows media player and its CPU Usage was 2%. I have no timers or loops in my program just the butons and the form, and i have no idea why it uses my CPU so much. |
| X PaYnE X is offline | |
| | #2 |
| Semi n00b Join Date: Jun 2003
Posts: 293
| 60% !!What compiler? Can I see some of your code? I mean, my application I'm making is filled with wrappers for most of my controls and subclasses for heaps of controls and I get a max of 4% usage and that takes a lot of stuff to do that. What processor do you have? How much ram? |
| Mithoric is offline | |
| | #3 |
| Registered User Join Date: Aug 2003
Posts: 288
| Compiler: MSVC++ 6 Processor: 3 Ghz Pentium 4 Memory: 1024 mb ram and the code was messy (i dont know how to add tabs to make my code look neat with code tags lol) to add on this so im going to attach it |
| X PaYnE X is offline | |
| | #4 |
| Semi n00b Join Date: Jun 2003
Posts: 293
| Nice system ... Well with specs like that it shouldn't make a hit when it's just idle.[edit:] Well there is nothing in your code that should make it go that high when you aren't actually doing anything with it. If however you are say, typing and clicking buttons and stuff 60% is not to hard to reach although even on my system (2.8Ghz) I only hit 38%, but then again my system is different because of my massive cooling. Is it very hot? Maybe you have a cooling problem, the closer to super conductivity the faster the system and less constant load. Last edited by Mithoric; 12-21-2003 at 01:23 AM. |
| Mithoric is offline | |
| | #5 |
| Registered User Join Date: Aug 2003
Posts: 288
| Well im sure its not cooling lol 4 fans usually at a constant 30 celcius or less but it maybe the fact that i use peekmessage instead of getmessage, i just read a post about how it uses more of the CPU and lol why would i click useless buttons its 60% in idle, im going to try and use WaitMessage() before PeekMessage and maybe itll workoutThanx for the help though, Mithoric |
| X PaYnE X is offline | |
| | #6 |
| Registered User Join Date: Aug 2003
Posts: 288
| Well i fixed it and achieved 0% usage but it kinda sux, it paints slower and stuff, ill just switch to GetMessage i suppose, but the thing is I need the program to accept data from clients through winsock and I have NO idea how to implement it, so Im not really sure what to do Do you know how to implement a basic server to client program? into the code i already posted |
| X PaYnE X is offline | |
| | #7 |
| Semi n00b Join Date: Jun 2003
Posts: 293
| Sure, creating that is pretty simple. Here is a great winsock tutorial! http://www.hal-pc.org/~johnnie2/winsock.html |
| Mithoric is offline | |
| | #8 |
| Registered User Join Date: Aug 2003
Posts: 288
| dude this site is perfect, has tutorial and the code, THANX MAN!! you saved my life like twice now lol keep it up! thanx again mithoric |
| X PaYnE X is offline | |
| | #9 |
| Registered User Join Date: Aug 2003
Posts: 288
| just 1 question, does the code on his site support multiple clients to 1 server? I really dont know lol i just switched over from VB a couple of months ago and I've never used winsock until now so its all a bit blurry |
| X PaYnE X is offline | |
| | #10 |
| Semi n00b Join Date: Jun 2003
Posts: 293
| Hmm.. I'm not quite sure about that, I'll have to investigate. |
| Mithoric is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| questions on multiple thread programming | lehe | C Programming | 11 | 03-27-2009 07:44 AM |
| Net cpu usage of pthreads?! | mynickmynick | C++ Programming | 15 | 09-26-2008 07:59 AM |
| Help with high CPU usage | 51dunk | C Programming | 11 | 07-23-2008 02:25 AM |
| Calculating CPU Usage | vitaliy | Linux Programming | 3 | 08-21-2005 09:38 AM |
| fseek high cpu usage? | chunlee | C Programming | 2 | 02-19-2005 07:27 AM |