Topic: uncaught_exception vs. threads
Author: restor <akrzemi1@interia.pl>
Date: Thu, 6 Sep 2007 11:28:42 CST Raw View
Hi,
In the current standard std::uncaught_exception indicates if there is
at least one uncaught exception in the program. What is it going to
indicate in multi-threaded c++0x? at least one uncaught exception in
the program or in the the thread that it is called from?
Anyway, can you safely throw in one thread if we unwind the stack in
the other?
&rzej
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Simon.Richter@hogyros.de (Simon Richter)
Date: Thu, 6 Sep 2007 21:11:22 GMT Raw View
Hi,
restor wrote:
> In the current standard std::uncaught_exception indicates if there is
> at least one uncaught exception in the program. What is it going to
> indicate in multi-threaded c++0x? at least one uncaught exception in
> the program or in the the thread that it is called from?
In the thread that it is called from. This information is pretty
meaningless program-wide, and may no longer be accurate after the
function returned anyway.
> Anyway, can you safely throw in one thread if we unwind the stack in
> the other?
Each thread has its own stack. The only interesting thing would be
rethrowing an exception that caused a thread's startup function to exit
in the thread that collects the thread's return value; that would need
language support, however.
Simon
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]