Userspace threads and C++ exceptions

Maurice Gittens mgittens@gits.nl
Mon Jun 19 11:29:00 GMT 2000


Hi Martin,

>
>I'm not a exactly sure what you mean by "userspace thread", if the
>ones created by pthread_create qualify, then yes, g++ provides such a
>mechanism. Just configure gcc with --enable-threads, and the exception
>handling will be thread-safe.
>


For me userspace threads are threads which are not scheduled by the kernel
scheduler of the OS.

phtread_create creates kernelspace threads (at least on Linux it does.)

My question refers to threads which are rolled by hand using the functions
getcontext, setcontext, makecontext and swapcontext defined in ucontext.h.

On NT such threads (called fibers) are provided by the OS and the compiler
provides a switch which allows C++ exceptions to work with fibers.

My original question was thus: Is there a way to get C++ exceptions working
with
such home grown thread implementations.

Thanks, with regards from Maurice.

>Regards,
>Martin
>




More information about the Gcc mailing list