- 论坛徽章:
- 0
|
我的理解确实有些问题,参考了些资料加上版主的指点,总结一下,希望能加深理解:
在现在的linux系统中,不管是2.4内核还是2.6内核, 不管是传统的linuxthreads还是新兴的NPTL,
与"是否需要由glibc中的一个额外的线程来管理其他用户线程"是没有联系的.
传统的linuxthreads中和新的NPTL均是1:1模型.
on fedora4, 通过以下命令可以看到一个进程中各个线程的ID号(PID是进程的pid):
ls -l /proc/PID/task/
在redhat9以及redhat以后的发行版本(fedora, AS...)中,均是使用NPTL模式的,虽然redhat9是2.4内核.
通常这样验证自己的系统是否支持NPTL,存在类似以下红色行表示支持:
[root@localhost transmitdemo]# getconf GNU_LIBPTHREAD_VERSION
NPTL 2.4
[root@localhost transmitdemo]# /lib/libc.so.6
GNU C Library development release version 2.4, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.0 20060304 (Red Hat 4.1.0-2).
Compiled on a Linux 2.6.9 system on 2006-03-07.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
[ 本帖最后由 yulc 于 2006-5-18 09:17 编辑 ] |
|