Best method for silent exception handling

delphi package - automated exception handling

Re: Best method for silent exception handling

Postby madshi » Wed Dec 07, 2016 9:32 pm

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.
madshi
Site Admin
 
Posts: 9203
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Postby Tahtu » Wed Dec 07, 2016 9:47 pm

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?
Tahtu
 
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Postby madshi » Wed Dec 07, 2016 9:51 pm

Yes, that's what I meant.
madshi
Site Admin
 
Posts: 9203
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Postby Tahtu » Wed Dec 07, 2016 9:56 pm

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

Re: Best method for silent exception handling

Postby Tahtu » Thu Dec 29, 2016 9:21 am

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.)
Tahtu
 
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Postby madshi » Thu Dec 29, 2016 9:37 am

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.
madshi
Site Admin
 
Posts: 9203
Joined: Sun Mar 21, 2004 5:25 pm

Re: Best method for silent exception handling

Postby Tahtu » Thu Dec 29, 2016 9:50 am

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...
Tahtu
 
Posts: 51
Joined: Thu Sep 06, 2012 12:03 pm

Re: Best method for silent exception handling

Postby madshi » Thu Dec 29, 2016 9:55 am

Thanks, that's good to know! :)
madshi
Site Admin
 
Posts: 9203
Joined: Sun Mar 21, 2004 5:25 pm

Previous

Return to madExcept

Who is online

Users browsing this forum: No registered users and 1 guest