> I think that the throw mechanism uses the error handler and > any unwinding done to reach it in flat mode, like longjmp() > in C. Which error handler are you talking about and what is 'flat mode'? ARe you referring to a specific implementation of exception handling? If so, remeber: the existence of a bad or broken implementation of a concept is no proff against that conecpt! > longjmp() is one of the things one is expressly warned > not to use in an interrupted environment. As you know, it > uses a static data structure (or several). No, I don't know, because I never usef setjmp/longjmp. > There is no way to > know whether the time between when throw occurs and when the > handler is executed affords any protection to the variables > and to the stack involved. Sorry, his makes no sense at all. > If an interrupt occurs in the same > thread and the interrupt thread does anything related to the > throw context (such as, initializing the throw data block > upon entry into the try segment), An interrupt executes on its own stack or on an extension of the interrupted stack. the exception throwing/hndling/catching mechanism can (and should) be implemented fully reentrant, so there will be no problem at all. > So unless throw is specifically thread safe in a > compiler I don't think that it can be used in an > interruptible environment. Of course, anything that is not 'reentrant'-safe can not be used in both main and interrupts. But throw/catch can and should be fully reentrant. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist