
I have never used boost::asio but a complete example of how to use
boost::exception_ptr can be found here (see Cloning and Re-Throwing an
Exception) :
http://www.boost.org/doc/libs/release/libs/exception/doc/tutorial_exception_...
Let me know if this works for you.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
On Tue, Jul 21, 2009 at 11:00 AM, Zachary Turner
Suppose I have some io_service object in which I call run() from thread A. Thread A is the main controller of the i/o operations and does things like issuing reads and, upon completion, issuing writes for those reads. The writing service might wish to spawn off some child services that runs in thread B. So when thread A says writer.async_write_data() all it really does is call child_writer_service.post() with the data.
Supposing an exception occurs in thread B, what is the best way to have this terminate the entire asio pipeline and propagate the exception all the way up to outside of thread A's call to io_service::run()?
I've looked at the sample code on the boost::exception tutorial but I'm unable to apply this to the situation in asio, either due to differences in the threading model or due to my own misunderstandings.
Thanks _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users