Board index » off-topic » Re: Thread : freezing app.

Re: Thread : freezing app.


2005-02-15 06:22:52 AM
off-topic18
Quote

Overall, I'm a bit surprised that the main thread cannot keep up. You
data
rate must be enormous.
The other odd thing is that you say the process CPU shows up at 0, no matter
what. If the main-thread drawing rate was the holdup, I would expect the
CPU to be pegged at the end-stop.
Rgds,
Martin
 
 

Re:Re: Thread : freezing app.

Martin James wrote:
Quote
The other odd thing is that you say the process CPU shows up at 0, no
matter what. If the main-thread drawing rate was the holdup, I would
expect the CPU to be pegged at the end-stop.
Never underestimate the {*word*99}pness of Liz
 

Re:Re: Thread : freezing app.

Quote

>I'll let Remy sort it out :)
He did! Aparrently, you have to clear the IOhandler inputBuffer after a
disconnect before you can connect again.
Quote
I think Remy hates me :)
Surely not!
Rgds,
Martin
PS I posted the demo app at last, but you've probaly written your stuff by
now.
Rgds,
Martin
 

{smallsort}

Re:Re: Thread : freezing app.

Martin James wrote:
Quote
He did! Aparrently, you have to clear the IOhandler inputBuffer
after a disconnect before you can connect again.
Kinda makes sense I suppose, but on the other hand, would seem that if
its essential why does the component not do it for itself on
disconnection..
Quote
PS I posted the demo app at last, but you've probaly written your
stuff by now.
Nope, I slept :) (Was v-day and all that, too much wine and all)
I have got and am going to have a look, thank you kindly so much for
your help.
 

Re:Re: Thread : freezing app.

Martin James wrote:
Quote
Odd. I would not expect a single socket read to return more than,
say, 8k at a time no matter how fast the data was coming in, (unless
you are using overlapped IO with huge application-supplied buffers,
which I am sure you are not).

So, I would expect that no more than 8k would be posted at one time
to the main thread. I would guess that should allow key & click
messages to be process reasonably quickly, but perhaps not.
I replaced the memo1 in your demo with my useless display component,
same deal, but it works fine with a memo, thus proving the ever
{*word*99}ness of me. Problem is, I havent found a good vt100 component that
does all I need thats free... and this one is great except under heavy
load (I didnt write it all, I did however make a lot of it, and a large
number of alterations to it)
 

Re:Re: Thread : freezing app.

Martin James a écrit :
Quote
>Thank you Joseph, I'll also try to run your app on the faulty PC.
>Yet, my app freezes even if I dont use the synchronize.
>
Use postMessage as suggested by Joseph - it's just about the only safe &
efficient way of communicating to the main thread. Everything else is a
deadlock-risk and/or has poor performance and/or has avodable
context-switches and/or has avoidable latency and/or wastes CPU.
Thank you Martin,
I understand that using postMessage is the good way to communicate and I
definitely would use it in my further apps and modify the current one as
soon as possible.
Yet sorry if I'm a little stubborn, but I really would like to
*understand* why my current app freezes !
Is it my fault ? Is it the PC fault ? is it the Windows fault ? is it
the Delphi fault ?
As a thread newbie I would definitely say that it is my fault ... but I
can't figure out where is the problem.
And I can't understand why the app works on every single PC where I
tested it except one and only one where it freezes. I would say even
more : on the PC where it freezes it only freezes with XP !
I formated the PC installed win2k and it works !
I re-formated the PC installed XP and it freezes !
On other XP PC it works !
Help Mulder & Scully where are you ? ;-P
 

Re:Re: Thread : freezing app.

"Galadriel" < XXXX@XXXXX.COM >skrev i en meddelelse
Quote
I formated the PC installed win2k and it works !
I re-formated the PC installed XP and it freezes !
On other XP PC it works !
Help Mulder & Scully where are you ? ;-P
I'm here!
I tried the app on my XP and let it run for about 6 minutes. No freeze.
Thoughts:
You are constantly adding lines to the memo, so the contents grow all the
time. Could the huge amount of data in the memo be the reason?
Or is there a difference on your XP and others XP where it works?
I'm thinking about different windows updates and security patches.
Could it be that the XP that freezes do not have all patches installed?
 

Re:Re: Thread : freezing app.

Quote
I replaced the memo1 in your demo with my useless display component,
same deal, but it works fine with a memo, thus proving the ever
{*word*99}ness of me. Problem is, I havent found a good vt100 component that
does all I need thats free... and this one is great except under heavy
load (I didnt write it all, I did however make a lot of it, and a large
number of alterations to it)
Write the data out of the serial port & connect up an old DEC terminal :)
I wuld not like to advise on terminals/emulators - I've never written one.
In the othe, more complex, demo, I used the Async Pro terminal & emulator.
This is now free, AFAIK, on SourceForge. Maybee is lacks some funtionality
or is slow anyway.
Rgds,
Martin
 

Re:Re: Thread : freezing app.

Quote

And I can't understand why the app works on every single PC where I
tested it except one and only one where it freezes. I would say even
more : on the PC where it freezes it only freezes with XP !
This does sound like hardware, but how this could affect your little test
app I do not know. It's not like the app is paging in and out and/or
flushing caches on a multiprocessor system. Besides, IMHO the kernel on XP
& W2k is the same, so I do not know how one OS could expoit a hardware
deficiency & the other not.
Very X.
Quote
I formated the PC installed win2k and it works !
I re-formated the PC installed XP and it freezes !
On other XP PC it works !

Help Mulder & Scully where are you ? ;-P
<g>You may have to resign yourself to using that PC for other work, (and
not buying another one).
Rgds,
Martin
 

Re:Re: Thread : freezing app.

Finn Tolderlund wrote:
Quote

"Galadriel" < XXXX@XXXXX.COM >skrev i en meddelelse
news:4211c35d$ XXXX@XXXXX.COM ...
>I formated the PC installed win2k and it works !
>I re-formated the PC installed XP and it freezes !
>On other XP PC it works !
>Help Mulder & Scully where are you ? ;-P

I'm here!
I tried the app on my XP and let it run for about 6 minutes. No
freeze. Thoughts:
You are constantly adding lines to the memo, so the contents grow all
the time. Could the huge amount of data in the memo be the reason?
I tried something similar in I made a filefinder, set it off on *.* on
C:\ :) placing the items in a listbox, even setting the capacity to
like 300k+ it only processed around 5k of lines before seemingly
stopping.. it seems the messages are just flooding in and drowing in
out everything else..
 

Re:Re: Thread : freezing app.

Martin James wrote:
[snip]
Quote
This does sound like hardware, but how this could affect your little
test app I do not know.
[snip]
How about faulty driver software?
This could also very well cause a freeze in the application.
Mainboard memory controller drivers and video card drivers come to mind.
I'd check that first before blaming it on the hardware itself.
There's many a driver delivered in Windows XP by Microsoft that will
cause bad things.
Also i experenced sometimes USB devices like memory sticks will hang
applications for no apparent reason..
 

Re:Re: Thread : freezing app.

Finn Tolderlund a écrit :
Quote
"Galadriel" < XXXX@XXXXX.COM >skrev i en meddelelse
news:4211c35d$ XXXX@XXXXX.COM ...

>I formated the PC installed win2k and it works !
>I re-formated the PC installed XP and it freezes !
>On other XP PC it works !
>Help Mulder & Scully where are you ? ;-P


I'm here!
<g>
Quote
I tried the app on my XP and let it run for about 6 minutes. No freeze.
Thoughts:
You are constantly adding lines to the memo, so the contents grow all the
time. Could the huge amount of data in the memo be the reason?
No, in fact this app is really really simplified one, and it takes a lot
more time to freeze ... but the real app will freeze after less than a
minute so there is not a huge amoun of data in the TMemo.
Quote
Or is there a difference on your XP and others XP where it works?
No diff except the hardware itself.
Quote
I'm thinking about different windows updates and security patches.
Could it be that the XP that freezes do not have all patches installed?
surely, it's just a XP SP1, but the same XP SP1 on other machines
doesn't freeze.
Thank you.
 

Re:Re: Thread : freezing app.

Quote
I tried something similar in I made a filefinder, set it off on *.* on
C:\ :) placing the items in a listbox, even setting the capacity to
like 300k+ it only processed around 5k of lines before seemingly
stopping.. it seems the messages are just flooding in and drowing in
out everything else..

Here this is not the problem : not using threads to fill the memo
doesn't hang the app.
 

Re:Re: Thread : freezing app.

Martin James a écrit :
Quote
>And I can't understand why the app works on every single PC where I
>tested it except one and only one where it freezes. I would say even
>more : on the PC where it freezes it only freezes with XP !


This does sound like hardware, but how this could affect your little test
app I do not know. It's not like the app is paging in and out and/or
flushing caches on a multiprocessor system. Besides, IMHO the kernel on XP
& W2k is the same, so I do not know how one OS could expoit a hardware
deficiency & the other not.
It seems to me that W2k and XP doesn't handle the hyperthreading the
same way ? Could it be possible that XP handling the multithreading will
hit some instructions in the CPU that are bugged on the faulty machine
and Win2k will not ?
Or maybe some drivers are not the same between 2k and XP ?
Quote

Very X.


>I formated the PC installed win2k and it works !
>I re-formated the PC installed XP and it freezes !
>On other XP PC it works !
>
>Help Mulder & Scully where are you ? ;-P


<g>You may have to resign yourself to using that PC for other work, (and
not buying another one).

Yep, seems so ...
Regards.
 

Re:Re: Thread : freezing app.

Marco Caspers a écrit :
Quote
Martin James wrote:

[snip]

>This does sound like hardware, but how this could affect your little
>test app I do not know.

[snip]

How about faulty driver software?
This could also very well cause a freeze in the application.
Mainboard memory controller drivers and video card drivers come to mind.
I'd check that first before blaming it on the hardware itself.
How would you check it ? I can change the video card driver but for the
memory controller ?
Quote

There's many a driver delivered in Windows XP by Microsoft that will
cause bad things.

Also i experenced sometimes USB devices like memory sticks will hang
applications for no apparent reason..
Thanks.