POV-Ray : Newsgroups : povray.off-topic : Programming language discussion : Re: Programming language discussion Server Time
4 Sep 2024 01:15:44 EDT (-0400)
  Re: Programming language discussion  
From: Darren New
Date: 23 Oct 2010 14:36:10
Message: <4cc32b1a@news.povray.org>
Orchid XP v8 wrote:
> I'm not quite sure what to make of that, other than "people have 
> different terms for things".

Sure.

> Then again, this is from the community where "parallel" and "concurrent" 
> aren't the same thing...

They aren't.

> It just amuses me that if you have a single-threaded program that throws 
> an exception, the program halts and prints out a message on stderr. But 
> as soon as you have multiple threads... this doesn't happen any more.

I see.

> You'd think it would make more sense to rethrow an uncaught exception to 
> thread #0, but anyway...

No, because there's no reasonable context in thread 0 to which you could 
throw the exception. If you want to catch the exception, catch it in the 
thread where it happened.  It's perfectly reasonable, given how threads are 
usually defined as "run this function in a separate thread", which makes it 
trivial to wrap whatever in a top-level function that catches and handles 
otherwise-uncaught exceptions.

The fact that the program doesn't stop when the thread doesn't catch an 
execption is exactly why you kill threads from outside by coaxing them into 
throwing an exception.

> The GHC threading implementation also lacks things like being able to 
> assign priorities to threads, and so forth. 

That's a whole 'nuther can of worms.

-- 
Darren New, San Diego CA, USA (PST)
   Serving Suggestion:
     "Don't serve this any more. It's awful."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.