Signal-Safe Threads (ssthreads) SourceForge Logo

Linuxthreads leaves a lot to be desired for building large reliable system. It doesn't implement the pthreads priority avoidance protocols, it be cannot safely interrupted by signals, and it does no real deadlock detection between threads. These things are very useful for building large reliable system that must run for a very long time uninterrupted. Signal-Safe threads provides those functions. It also allows the use of any thread function from a signal handler.

As well, Signal-Safe threads will be POSIX compliant when the thread credentials work is done. It uses THREAD_CLONE, and it currently handles signals properly

Signal-Safe threads is getting pretty mature. For well-behaved programs (or, at least, not too badly behaved programs), it can be a drop-in replacement for LinuxThreads, meaning that you can take the libpthread.so.xxx from this package and replace the LinuxThreads one on you machine and most stuff will just work (or, more safely, set up an LD_LIBRARY_PATH for it). I have tested it with a large number of programs, and it works well. It integrates with glibc properly. The main problem is Java. Most JDKs are poorly behaved. They do wierd things with the stack, directly call kill on thread id's, and such. Some JVMs (the 1.3.1 version from IBM and Blackdown) work to some extent when running in LinuxThreads compatability mode, but will not work in POSIX compliant mode. See the README for more details.

Debugging support exists (although you cannot run in POSIX-compliant mode unless you have a gdb patch that is included.

The downside the Signal-Safe threads is speed. It's somewhat slower than LinuxThreads (locking an unlocked mutex takes around 80% longer on my box, cond is around 40% slower) because of all the things it does. It also require that the microprocessor have a compare-and-swap instruction. This requirement may go away in the future, but that will require Linux kernel changes.

If you want it, see the SourceForge page It only currently works on Linux on PowerPC and IA32 (Intel).