This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Userspace threads and C++ exceptions
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: Userspace threads and C++ exceptions
- From: "Maurice Gittens" <mgittens at gits dot nl>
- Date: Mon, 19 Jun 2000 20:28:23 +0200
- Cc: <gcc at gcc dot gnu dot org>
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
>