Best method for silent exception handling

delphi package - automated exception handling
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Post by madshi »

How is that data stored? Can you access it in a thread safe way?

Of course you could just ignore the danger of multi-threading and access the data directly. In most cases your exception handler will be called in the context of the main thread (if you use "trySync"), anyway.
Tahtu
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Post by Tahtu »

madshi wrote:How is that data stored? Can you access it in a thread safe way?
No.
madshi wrote:Of course you could just ignore the danger of multi-threading and access the data directly. In most cases your exception handler will be called in the context of the main thread (if you use "trySync"), anyway.
What do you mean with "trySync"? I think you mean "stTrySyncCallAlways", right?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Post by madshi »

Yes, that's what I meant.
Tahtu
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Post by Tahtu »

Thank you for your assistance!
Tahtu
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Post by Tahtu »

madshi wrote:What does EurekaLog do if the exception was raised by a secondary thread?
It runs in that secondary thread.
madshi wrote:Is your exception callback still called within the context of the main thread?
No.

... and the exception dialog ("MSClassics") uses the VCL.

(EurekaLog 7.5.)
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Post by madshi »

In my tests showing a VCL form in a secondary thread resulted in all sorts of problems. The VCL simply isn't thread safe. If EurekaLog does show a VCL form in a secondary thread, I can only imagine that it can't be perfectly stable.
Tahtu
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Post by Tahtu »

madshi wrote:If EurekaLog does show a VCL form in a secondary thread, I can only imagine that it can't be perfectly stable.
I agree with you: This solution of EurekaLog is bad. Your solution is much better! ... I wanted to let you know this...
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Post by madshi »

Thanks, that's good to know! :)
Post Reply