Messages in this thread | | | Subject | CLONE_PPID support for LinuxThreads | From | David Wragg <> | Date | 31 Jul 1999 11:02:41 +0000 |
| |
I have modified LinuxThreads to support Tim Hockin's CLONE_PPID kernel patch. The aim is to make the cost of a pthread_create() approach the cost of a clone(). In existing LinuxThreads, pthread_create() is many times more expensive due to a context switch to the manager thread, which does the clone to actually create the thread, and another context switch back to the thread that called pthread_create(). With CLONE_PPID the thread calling pthread_create() can do the clone() directly. On my dual PPro-200 machine this reduces the cost of a pthread_create() from about 23000 cycles to about 11000 cycles.
My patch is against glibc/linuxthreads-2.1.1 (actually against RedHat's glibc-2.1.1-6, but they should apply to vanilla glibc-2.1.[12] also). Currently the patch only includes support for x86. You can download it at <URL:http://www.doc.ic.ac.uk/~dpw/linux/glibc-2.1.1-ppid.patch>. I have also put a recent version of Tim's kernel patch at <URL:http://www.doc.ic.ac.uk/~dpw/linux/linux-2.2.10-ppid.patch>
Once you have rebuilt glibc with the patch, the easiest way to test the changes is to place the libc and libpthread binaries into a directory and set LD_LIBRARY_PATH so that your existing LinuxThreads program will use them. I have put a tar files containing prebuilt libraries at <URL:http://www.doc.ic.ac.uk/~dpw/linux/ppid-libs-0.1.i386.tar.gz> (these are from RedHat's glibc-2.1.1-6, with my patch added).
Any feedback will be gratefully received, but I'm away on vacation for a week from today so it might take me a while to get back to you.
Regards, David Wragg
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |