Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to propagate an exception to the parent thread?

0
Posted

How to propagate an exception to the parent thread?

0

> Does anyone have or know of an approach to mixing threads with C++ > exception handling? Specifically, how to propagate an exception to the > parent thread. I can catch any exceptions thrown within a thread by way > of a try block in the entry function. The entry being a static class > member function. (I know, a “state of sin” wrt to C++ and C function > pointers, but it works.) Copying the exception to global (static or > free store) memory comes to mind. It was the original intention of the designers of the C++ language to allow one to throw/catch across thread boundaries. As far as I know the recently ratified ISO C++ standard makes no mention of threads whatsover. (The ISO C++ committee considered threads an OS and/or implementation, not a language issue. BTW please don’t send me a bunch of replies agreeing or disagreeing, I am not on the ISO committee, I am just reporting the facts. 😉 However, I am unaware of ANY compiler that implements the ability to throw/catch across thre

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123