The LinuxThreads library
The LinuxThreads library
LinuxThreads is an implementation of the Posix 1003.1c thread package for Linux.
Unlike other implementations of Posix threads for Linux, LinuxThreads provides kernel-level threads: threads are created with the new clone() system call and all scheduling is done in the kernel.
The main strength of this approach is that it can take full advantage of multiprocessors. It also results in a simpler, more robust thread library, especially w.r.t. blocking system calls.
For more information, see the LinuxThreads README and the LinuxThreads Frequently Asked Questions.
Warning
LinuxThreads is now closely integrated in the glibc GNU C library. The initial author of LinuxThreads (Xavier Leroy) is no longer active on LinuxThreads; maintenance and further developments are mostly handled by Kaz Kylheku and the glibc team, in particular Ulrich Drepper.
The information on this Web page has not been updated in a while and may not be 100% up to date (except the FAQ, which is still actively maintained). The glibc mailing lists often contain more up-to-date information.
General questions about LinuxThreads and programming with POSIX threads should be posted on the comp.programming.threads newsgroup.
Bug reports should be sent directly to the glibc development team using the glibcbug script that is installed on your machine along with glibc itself.
Obtaining LinuxThreads
For Linux systems based on glibc 2 (e.g. RedHat 5.0 and later): the glibc 2 version of LinuxThreads is distributed along with glibc 2 itself. If you have installed a Linux distribution based on glibc 2 (such as RedHat 5.0 and later, or indeed most major Linux distributions these days), you already have LinuxThreads on your computer. Congratulations. Otherwise, both glibc 2 and the associated LinuxThreads distribution can be found on Cygnus/RedHat source collection, and also on any FTP site that mirrors GNU software (the Cygnus/RedHat site is sometimes more up-to-date than the GNU sites).
For Linux systems based on libc 5 (e.g. old versions of Slackware): The source distribution of LinuxThreads for libc 5 is available at ftp://ftp.inria.fr/INRIA/Projects/cristal/Xavier.Leroy/linuxthreads.tar.gz. Please note that the libc 5 version of LinuxThreads is obsolete and no longer maintained. An upgrade to glibc 2 is highly recommended for reliable multithreading programming.
Debugging threaded programs with GDB: Recent versions of gdb and glibc support the debugging of multithreaded programs. For instance, RedHat 6.2 and later come with a thread-aware version of gdb.
For older systems: see H.J.Lu\s patches for gdb, which include thread support and more. The very first attempt at multi-threaded debugging for LinuxThreads was the patches for gdb 4.17 developed at The Open Group, Grenoble, but this is now largely obsolete. The Open Group patches are for glibc 2. Kaz Kylheku back-ported them to libc 5: patch for LinuxThreads 0.71/libc5 and patch for GDB 4.17.
Documentation
Two FAQs from comp.programming.threads: O\Sullivan\s FAQ and Lewis\ FAQ.
Getting Started With POSIX Threads, by Tom Wagner and Don Towsley.
Sun\s pthread pages.
LinuxThreads comes with a complete set of man pages.
Code samples from Programming with POSIX?Threads, D. R. Butenhof, Addison-Wesley.
Code samples, sources, infos from Multithreading Programming Techniques, S. Prasad, McGraw Hill.
LinuxThreads-related software
Richard Neitzel\s libaio, a library of POSIX.1b compliant asynchronous I/O functions based on LinuxThreads.
The Adaptive Communication Environment (ACE) contains C++ wrappers for LinuxThreads and much, much more.
Jim Doyle\s DCE Threads Emulation Package for LinuxThreads allows applications written with DCE threads (a.k.a. draft 4 POSIX threads) to run easily on top of LinuxThreads.
The AOL multithreaded Web server uses LinuxThreads for its Linux version.
Software AG\s port of DCOM for Linux also uses LinuxThreads.
LinuxThreads is used in MpegTV Player, a commercial/shareware real-time MPEG Video player (with audio/sync) and Video-CD player for Linux.
Com-One\s Video live server runs under Linux and uses LinuxThreads.
Blackdown\s port of the Java Development Kit 1.2 for Linux supports \"native\" threads built on top of LinuxThreads as an alternative to the JDK\s own \"green\" threads. The Kaffe Java implementation does the same.
GNAT, the GNU Ada95 compiler, comes with a \"native\" run-time system that implements Ada tasks using LinuxThreads.
Ted Baker\s FLORIST package is a POSIX.5 library for GNAT that can be used as an Ada95 interface to LinuxThreads and other Linux system calls. It also includes a POSIX conformance test kit.
Proxy, a threaded IP filtering proxy server.
--------------------------------------------------------------------------------
[email protected]发布人:gloomy 来自: