View topic - Trap errors in a thread

Trap errors in a thread

For discussion of realtime and/or embedded programming.

Trap errors in a thread

Postby olivier_g » Mon May 03, 2021 8:35 am


Is there a way to trap all errors including segmentation fault in a thread independently from other threads ?

Something like a try catch(...) in C++


New Member
Posts: 4
Joined: Tue Feb 10, 2015 9:06 am

Re: Trap errors in a thread

Postby Tim » Mon May 03, 2021 1:02 pm

I don't fully understand your question.

Are you saying from Thread B, you want to trap all errors of Thread A? If that's what you mean, what exactly do you want to do if you detect such an error? Just log it or somehow allow Thread A to continue (which will be virtually impossible).

Are you wanting to do this in C or C++ and what's wrong with just using Try-Catch?

Senior Member
Posts: 1524
Joined: Wed Mar 10, 2004 12:28 am

Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest