[DUG] Program crashes - anyone knows why?
Matthew Comb
matt at ferndigital.com
Mon Nov 27 09:26:34 NZDT 2006
I would be more concerned with what the threads do with the information
they get once completed searching.
e.g. displaying on main form in some way.
Exceptions within a thread shouldn't propogate to the main thread unless
im missing something?
Matt.
> Thanks Conor, I've added (A) and sent the application to the client, so
> let's hope there will be some progress.
>
>
> On Sun, 26 Nov 2006 20:35:38 +0100, Conor Boyd <Conor.Boyd at trimble.co.nz>
> wrote:
>
>> That's a very detailed email... ;-)
>>
>> Without delving deeper, I've a couple of comments/suggestions.
>>
>> A) You definitely need a try-except block in your Execute method. You
>> must not let unhandled exceptions propagate out of a thread. Even if
>> you only put a call to OutputDebugString in your exception handler, then
>> that means you could use e.g. DebugView from Sysinternals to view
>> exceptions being thrown.
>>
>> B) Try adding the madExcept library from www.madshi.net to your
>> application. It should help hugely in tracking down unhandled errors
>> like this, especially when they are happening on a remote machine. You
>> can configure it so that in the event of an error, your program can
>> automatically email you the error reports including call stacks, etc.
>>
>> C) You could also try using the URLDownloadToFile function from the
>> URLMon unit instead. I use it in a threaded application, and it works
>> fine for me.
>>
>> I don't know what you're using to access Google, but I've been using the
>> Indy components very successfully in one of my projects.
>>
>> Good luck in trying your error down...
>>
>> HTH,
>>
>> Conor
>>
>> -----Original Message-----
>> From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
>> On Behalf Of Gajo Csaba
>>
>> I wrote a multithreaded application for a client and it crashes on the
>> client's computer, while it works ok on mine. Can someone give me a clue
>> as to what might be the problem?
>>
>> The program works like this: I have two TThreadLists: one contains a
>> list of keywords (~20000) while the other a list of proxy servers
>> (~500). When the user clicks on the button, 21 threads are created. 1
>> thread directly accesses Google, enters the keyword and processes the
>> result. The other 20 threads do the same, except they use a proxy
>> server.
>>
>> OK, so each thread grabs a keyword from the list and then removes it
>> from the list, so no one else could use it again. It tries to access the
>> internet. If the connection fails then it means the proxy doesn't work,
>> so it gets another proxy address from the list. No two threads ever
>> share the same proxy. If there are no more free proxies left, the thread
>> dies (and returns the unprocessed keyword to the list).
>>
>> [snip]
>>
>> _______________________________________________
>> Delphi mailing list
>> Delphi at ns3.123.co.nz
>> http://ns3.123.co.nz/mailman/listinfo/delphi
>>
>>
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
More information about the Delphi
mailing list