This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Userspace threads and C++ exceptions


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
>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]