Proposal: new signal-handling API

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Jul 21 02:37:20 EDT 2008


On 2008 Jul 21, at 2:20, Bulat Ziganshin wrote:
> Monday, July 21, 2008, 7:58:07 AM, you wrote:
>>> [Stuff about doing signals as exceptions.]
>
>> I think that the issue with this is, to which threads do you  
>> deliver the
>> exceptions?
>
> main one. it should handle other threads as needed


I'm not so sure:  if the point is to release resources on signal, you  
want to deliver the exception to (potentially) all threads, and the  
main thread may not have any idea of the needs of the library being  
used by another thread.

I think I would handle these exceptions by sending them only to  
threads which have registered an interest (withSignalException sigMask  
$ do ... :: Either SignalException a).  If a SignalException somehow  
ends up being rethrown back to the runtime, this is likely to be an  
error which should cause program termination --- but I can also see it  
being quietly ignored,  This might be a +RTS option.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Libraries mailing list