View topic - How to handle exceptions in multithreading?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 14 Aug 2010, 09:40 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
Okay, after I got an offscreen OpenGL context & math syncing working in the multithreaded loadingstage, now comes the exceptions handling.

I modularized the exception handling, so now both the mainthread and the workerthreads use the same try..catch.

My problem is now if I just catch an exception in the workerthread, the mainthread hangs and shows a crash-report. So the solution is to quit all threads and to show the crash/content_error report in the mainthread. Doing so isn't easy AFAIK.
The only solution I see is too use execlp, but that would need a new binary (or new arguments for binary, so you can launch it to just display the error-report).

This seems a bit dirty, so are there better ways and how does GML handle this situations?


Top
 Offline Profile  
 
PostPosted: 15 Aug 2010, 11:20 
Spring Developer

Joined: 16 Dec 2006, 20:59
Why does the main thread hang and show a crash report? Hang I can understand (sync, barriers etc), but not the crash.

I would probably try to interrupt all other threads (makes them throw boost::thread_interrupted) in the exception handler and then let the threads exit cleanly while the main thread does some error output.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.