> FYI, I tested with a slow ISDN (64 kbit) connection today. 100% CPU
> without Sleep(1).

Check your message loop. You _must_ call GetMessage, not PeekMessage.
PeekMessage use 100% CPU (It returns immediately no matter if there is a
message or not). GetMessage use the very minimum (it is blocking if no
message).
--
Contribute to the SSL Effort.
Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


----- Original Message ----- 
From: "Carsten Muencheberg" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Monday, May 22, 2006 11:07 AM
Subject: Re: [twsocket] thread message loop question


> Arno Garrels schrieb:
> > Carsten Muencheberg wrote:
> >> Answering my own question:
> >>
> >> void __fastcall TForm1::HttpCli1DocData(TObject *Sender, Pointer
Buffer,
> >>   int Len)
> >> {
> >> Sleep(1);
> >> }
> >>
//------------------------------------------------------------------------
> >> --- 
> >>
> >> Did the trick, CPU is at 0% now. :-)
> >
> > Note, that CPU load depends also on your line speed. If you are testing
> > against a server on LocalHost or in a fast LAN CPU load can be much
higher
> > than running on a real world Internet connection.
> > Sleep() isn't recommended, instead use HTTPCli's built-in
bandwidthcontroller
> > if you think you must throttle CPU load.
> > BTW: Don't trust Taskmanager too much.
>
> Hi,
>
> FYI, I tested with a slow ISDN (64 kbit) connection today. 100% CPU
> without Sleep(1).
>
> Carsten
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to