exceptions and threads

Andrew Zabolotny bit@freya.etu.ru
Tue Dec 16 01:41:00 GMT 1997


On Fri, 12 Dec 1997 18:11:30 +0100, Christian Millour wrote:

>>                                                       On the two most
>> advanced platforms for multithreaded programming, Solaris 2.6 and
>> Digital Unix-latest, when you cancel a thread that is running C++
>> code, destructors are automatically invoked and the stack is unwound
>> until the thread entry point (the function handed to
>> pthread_create()).
>This is cool and the way it should be... Does it work even in Async 
>Cancel mode ? 

a) imho, this should not work for async cancel mode... otherwise you will
have no way to shutdown
a single thread which has locked (maybe even as a result of a previous
async cancel signal)
b) does posix threads have a mechanism for sending signals *across
threads*?
This way it becomes easy (throw'ing exceptions from signal handlers should
work, imho, provided you
have frame unwind info for the signal handler).
c) If gcc will be involved in such things, wouldn't it be great to make
the thread-stuff visible to the outer-world
too (i.e. a almost-standard thread library with gcc -- maybe inside
libgcc)? Anyway, gcc will need such
a library for internal needs.

Greetings,
    _\ndy@teamOS/2




More information about the Gcc mailing list