Question on pthread_cancel/pthread_exit and thread stack unwind

Ramadass, Ramanathan Ramanathan.Ramadass@spirentcom.com
Thu Sep 16 22:13:00 GMT 2004


Not necessarily. pthread library is separate from gcc. The compiler
proper does not care. The behaviour you are looking for is in the
runtime startup code(files named crtbegin.o, crtend.o etc; use gcc -v
and note the actual files being used in the link line) and also in the
standard libraries. Note that the startup object files are specific to
the compiler and are built when you build gcc. It is there that you will
find the setup and calls for global ctors/dtors. You might want to look
at the CRT code to figure out what is being done. You might also need
the pthread API implementation itself (i think it comes with the glibc
source) to see how the pthread_cancel/pthread_exit calls interact with
the runtime code.

HTH
Ram

-----Original Message-----
From: Yufeng_Xiong@ltx.com [mailto:Yufeng_Xiong@ltx.com]
Sent: Thursday, September 16, 2004 2:12 PM
To: lrtaylor@micron.com
Cc: gcc-help@gcc.gnu.org
Subject: RE: Question on pthread_cancel/pthread_exit and thread stack
unwind






On the same Solaris platform, using SUN's Workshop6.2 compiler,
there's no such problem, with the same pthread library, so the compiler
has something to do with it.

Yufeng




 

             lrtaylor@micron.c

             om

 
To 
             09/16/2004 05:04          <Yufeng_Xiong@ltx.com>

             PM
cc 
                                       <gcc-help@gcc.gnu.org>

 
Subject 
                                       RE: Question on

                                       pthread_cancel/pthread_exit and

                                       thread stack  unwind

 

 

 

 

 

 





Hi Yufeng,

I may be off, but I believe that pthreads is really separate from GCC,
so if stack unwinding doesn't occur, etc., etc., with pthread_cancel and
pthread_exit, it may be more of an issue to take up with the maintainers
of the pthread library on Linux.  You might try there and see what kind
of a response they give you...

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Eljay Love-Jensen
Sent: Thursday, September 16, 2004 2:47 PM
To: Yufeng_Xiong@ltx.com
Cc: gcc-help@gcc.gnu.org
Subject: Re: Question on pthread_cancel/pthread_exit and thread stack
unwind

Hi Yufeng,

 >I'm not sure how active you are involved with the GCC development...

I'm a user of GCC just like yourself, much like most of the people on
this
forum.  This is a user-community supported self-help forum.

 >...is there a technical problem preventing this from happening or it's

just nobody is considering doing it?

Well, yes, it's a technical problem of sorts.  The C++ specification
does
not support multithreading programming.

POSIX Threads in C/C++ are an "after market bolt-on", so to speak.

There are other languages which handle multithreaded programming better
than C++:  Ada and Java come to mind.  Those are but two examples; I'm
sure
there are many other languages which are multithread savvy.

 >We can consider other compilers but we really like to use GCC because
then we can pretty much use the 'same' compiler for different platforms.

As I understand it, GCC supports Ada and supports Java.  So you could
stick
with GCC.

HTH,
--Eljay




More information about the Gcc-help mailing list