Arno Garrels wrote:
> Markus Humm wrote:
> 
>>>>> I mean if a message loop of 3 sec. doesn't give him enough time
>>> Possibly the message loop isn't implemented properly?
>>> Please show us some code.
>> 
>> Ok, my message loop was constructed like this:
>> 
>> var msg:TMessage;
>>    t:Dword;
>> 
>> begin
>>  t:=GetTickCount;
>>  while (abs(GetTickCount-t) < 3000) do
>>  begin
>>    PeekMessage(msg, 0, 0, 0, pm_remove);
>>    TranslateMessage(msg);
>>    DispatchMessage(msg);
>>    sleep(20);
>>  end;
>> end;
> 
> That's most likely the cause, looks like an attempt to
> workaround the async nature of ICS. A message loop should
> use GetMessage and no Sleep().

And the loop should be terminated dynamically when it is no 
longer needed by posting a message i.e. the WM_QUIT message.
If something blocks while in that loop 3 seconds might not 
be enough. It's also burning CPU cycles for nothingh since
with every sleep a thread-switch is enforced.   

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

Reply via email to