[lug] pthreads, reprise

D. Stimits stimits at idcomm.com
Thu Jun 1 17:50:10 MDT 2000


Paul Hardiman wrote:
> 
> I have never been successful giving pthread_create the address of a
> member function.
> I am not clear why the C++ compiler/linker cares, because the address
> for that method is not going to change and should be linkable.

It is a result of name mangling for relocatable code. C doesn't have the
same relocation problems caused by overloading and inheritance,
especially virtual; since the libs are built around C calling
convention, you have to invent a new mechanism for C++ to exist within
it. You could make a system based on C++ libs, but the boot time and
runtime support required would be enormous. Probably you'd need a boot
cd for the image, rather than a boot floppy.

> 
> 
> Kevin King wrote:
> 
> > Once again, my thanks to those who helped with the linker option for
> >
> > multithreaded C++ code.  Perhaps you would be willing to assist with
> > another
> > question?
> >
> > Is it possible to invoke pthread_create(..) and pass the name of a
> > class
> > method?  I am having no problems passing the names of routines that
> > are
> > outside the class, but am unable to pass a class method name.  I am
> > suspecting it has something to do with name decoration, but I have
> > no idea
> > how to make it work.
> >
> > --Kevin
> > kevin at precisonline.com
> > http://www.precisonline.com
> > http://www.precisonline.com/gold.htm
> >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 
> --
> Regards,
>                  Paul Hardiman
>             InterMedia, Inc (Colorado)
>          Informations Systems Consulting
> 303-581-0606, Fax 581-0506, hardiman at hardiman.com
> 
>   _______________________________________________ Web Page:
> http://lug.boulder.co.us Mailing List:
> http://lists.lug.boulder.co.us/mailman/listinfo/lug




More information about the LUG mailing list