glibc, linuxthreads, floating stacks

Petr Salinger Petr.Salinger at t-systems.cz
Wed Dec 14 16:24:33 UTC 2005


> > It is rather easy to enable FLOATING_STACKS in glibc/linuxthreads
> > for our current kfreebsd-5 kernel. The same syscall can be also 
> > used later to enable __thread keyword and whole TLS.
> > 
> > The attached pt-machine.h should go into 
> > glibc-2.3/linuxthreads/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i486/pt-machine.h
> > 
> > It applies to both glibc 2.3.0 and 2.3.5, successfully tested with 2.3.0.
> 
> Looks ok to me, it would be nice if somebody could apply it? If I 
> remember correctly there is something to pass to configure to enble 
> __thread. Am I right?

For 2.3.0 I would vote to only enable FLOATING_STACKS implementation,
no the __thread keyword. Everything what is needed is to copy pt-machine.h 
file and rebuild glibc.

For 2.3.6, we can start with already tested FLOATING_STACKS enabled. 
After that I would prepare appropriate 
linuxthreads/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/tls.h
and you can add --with_tls and --with___thread to configure. ;-)

> > Can I help with something ?
> I have recently found that in glibc 2.3.5 the support for non RT-signals 
> in linuxthreads has been removed. 

Not really, even snapshot glibc-2.3-20051212 supports them. 
Removed is only support for building against old linux kernel headers. 

glibc 2.3.x still support running against kernels without RT signals,
using SIGUSR1/SIGUSR2, look at init_rtsigs() in linuxthreads/pthread.c for details.

It would be ok to use the same approach as in 2.3.0
 - use signals #32,#33,#34
 - use non-rt implementation for__pthread_restart/__pthread_suspend/__pthread_timedsuspend

Petr




More information about the Glibc-bsd-devel mailing list