#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:57+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man7/pthreads.7:26 #, no-wrap msgid "PTHREADS" msgstr "" #. type: TH #: man-pages/man7/pthreads.7:26 #, no-wrap msgid "2014-05-21" msgstr "" #. type: TH #: man-pages/man7/pthreads.7:26 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man7/pthreads.7:26 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man7/pthreads.7:27 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:29 msgid "pthreads - POSIX threads" msgstr "" #. type: SH #: man-pages/man7/pthreads.7:29 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:36 msgid "" "POSIX.1 specifies a set of interfaces (functions, header files) for threaded " "programming commonly known as POSIX threads, or Pthreads. A single process " "can contain multiple threads, all of which are executing the same program. " "These threads share the same global memory (data and heap segments), but " "each thread has its own stack (automatic variables)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:39 msgid "" "POSIX.1 also requires that threads share a range of other attributes (i.e., " "these attributes are process-wide rather than per-thread):" msgstr "" #. type: IP #: man-pages/man7/pthreads.7:39 man-pages/man7/pthreads.7:41 man-pages/man7/pthreads.7:43 man-pages/man7/pthreads.7:45 man-pages/man7/pthreads.7:47 man-pages/man7/pthreads.7:49 man-pages/man7/pthreads.7:51 man-pages/man7/pthreads.7:54 man-pages/man7/pthreads.7:56 man-pages/man7/pthreads.7:59 man-pages/man7/pthreads.7:65 man-pages/man7/pthreads.7:70 man-pages/man7/pthreads.7:73 man-pages/man7/pthreads.7:76 man-pages/man7/pthreads.7:84 man-pages/man7/pthreads.7:88 man-pages/man7/pthreads.7:91 man-pages/man7/pthreads.7:95 man-pages/man7/pthreads.7:98 man-pages/man7/pthreads.7:103 man-pages/man7/pthreads.7:106 man-pages/man7/pthreads.7:683 man-pages/man7/pthreads.7:690 man-pages/man7/pthreads.7:702 man-pages/man7/pthreads.7:712 man-pages/man7/pthreads.7:716 man-pages/man7/pthreads.7:725 man-pages/man7/pthreads.7:735 man-pages/man7/pthreads.7:742 man-pages/man7/pthreads.7:749 man-pages/man7/pthreads.7:751 man-pages/man7/pthreads.7:754 man-pages/man7/pthreads.7:760 man-pages/man7/pthreads.7:763 man-pages/man7/pthreads.7:765 man-pages/man7/pthreads.7:767 man-pages/man7/pthreads.7:777 man-pages/man7/pthreads.7:797 man-pages/man7/pthreads.7:806 man-pages/man7/pthreads.7:812 man-pages/man7/pthreads.7:814 man-pages/man7/pthreads.7:816 man-pages/man7/pthreads.7:820 man-pages/man7/pthreads.7:825 man-pages/man7/pthreads.7:833 #, no-wrap msgid "-" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:41 msgid "process ID" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:43 msgid "parent process ID" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:45 msgid "process group ID and session ID" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:47 msgid "controlling terminal" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:49 msgid "user and group IDs" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:51 msgid "open file descriptors" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:54 msgid "record locks (see B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:56 msgid "signal dispositions" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:59 msgid "file mode creation mask (B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:65 msgid "current directory (B(2)) and root directory (B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:70 msgid "" "interval timers (B(2)) and POSIX timers (B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:73 msgid "nice value (B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:76 msgid "resource limits (B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:81 msgid "" "measurements of the consumption of CPU time (B(2)) and resources " "(B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:84 msgid "" "As well as the stack, POSIX.1 specifies that various other attributes are " "distinct for each thread, including:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:88 msgid "thread ID (the I data type)" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:91 msgid "signal mask (B(3))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:95 msgid "the I variable" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:98 msgid "alternate signal stack (B(2))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:101 msgid "real-time scheduling policy and priority (B(7))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:103 msgid "The following Linux-specific features are also per-thread:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:106 msgid "capabilities (see B(7))" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:109 msgid "CPU affinity (B(2))" msgstr "" #. type: SS #: man-pages/man7/pthreads.7:109 #, no-wrap msgid "Pthreads function return values" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:116 msgid "" "Most pthreads functions return 0 on success, and an error number of failure. " " Note that the pthreads functions do not set I. For each of the " "pthreads functions that can return an error, POSIX.1-2001 specifies that the " "function can never fail with the error B." msgstr "" #. type: SS #: man-pages/man7/pthreads.7:116 #, no-wrap msgid "Thread IDs" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:130 msgid "" "Each of the threads in a process has a unique thread identifier (stored in " "the type I). This identifier is returned to the caller of " "B(3), and a thread can obtain its own thread identifier " "using B(3). Thread IDs are guaranteed to be unique only " "within a process. A thread ID may be reused after a terminated thread has " "been joined, or a detached thread has terminated. In all pthreads functions " "that accept a thread ID as an argument, that ID by definition refers to a " "thread in the same process as the caller." msgstr "" #. type: SS #: man-pages/man7/pthreads.7:130 #, no-wrap msgid "Thread-safe functions" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:134 msgid "" "A thread-safe function is one that can be safely (i.e., it will deliver the " "same results regardless of whether it is) called from multiple threads at " "the same time." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:138 msgid "" "POSIX.1-2001 and POSIX.1-2008 require that all functions specified in the " "standard shall be thread-safe, except for the following functions:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:232 #, no-wrap msgid "" "asctime()\n" "basename()\n" "catgets()\n" "crypt()\n" "ctermid() if passed a non-NULL argument\n" "ctime()\n" "dbm_clearerr()\n" "dbm_close()\n" "dbm_delete()\n" "dbm_error()\n" "dbm_fetch()\n" "dbm_firstkey()\n" "dbm_nextkey()\n" "dbm_open()\n" "dbm_store()\n" "dirname()\n" "dlerror()\n" "drand48()\n" "ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n" "encrypt()\n" "endgrent()\n" "endpwent()\n" "endutxent()\n" "fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n" "ftw()\n" "gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n" "getc_unlocked()\n" "getchar_unlocked()\n" "getdate()\n" "getenv()\n" "getgrent()\n" "getgrgid()\n" "getgrnam()\n" "gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n" "gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n" "gethostent()\n" "getlogin()\n" "getnetbyaddr()\n" "getnetbyname()\n" "getnetent()\n" "getopt()\n" "getprotobyname()\n" "getprotobynumber()\n" "getprotoent()\n" "getpwent()\n" "getpwnam()\n" "getpwuid()\n" "getservbyname()\n" "getservbyport()\n" "getservent()\n" "getutxent()\n" "getutxid()\n" "getutxline()\n" "gmtime()\n" "hcreate()\n" "hdestroy()\n" "hsearch()\n" "inet_ntoa()\n" "l64a()\n" "lgamma()\n" "lgammaf()\n" "lgammal()\n" "localeconv()\n" "localtime()\n" "lrand48()\n" "mrand48()\n" "nftw()\n" "nl_langinfo()\n" "ptsname()\n" "putc_unlocked()\n" "putchar_unlocked()\n" "putenv()\n" "pututxline()\n" "rand()\n" "readdir()\n" "setenv()\n" "setgrent()\n" "setkey()\n" "setpwent()\n" "setutxent()\n" "strerror()\n" "strsignal() [Added in POSIX.1-2008]\n" "strtok()\n" "system() [Added in POSIX.1-2008]\n" "tmpnam() if passed a non-NULL argument\n" "ttyname()\n" "unsetenv()\n" "wcrtomb() if its final argument is NULL\n" "wcsrtombs() if its final argument is NULL\n" "wcstombs()\n" "wctomb()\n" msgstr "" #. type: SS #: man-pages/man7/pthreads.7:234 #, no-wrap msgid "Async-cancel-safe functions" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:238 msgid "" "An async-cancel-safe function is one that can be safely called in an " "application where asynchronous cancelability is enabled (see " "B(3))." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:241 msgid "" "Only the following functions are required to be async-cancel-safe by POSIX.1-" "2001 and POSIX.1-2008:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:247 #, no-wrap msgid "pthread_cancel()\n" "pthread_setcancelstate()\n" "pthread_setcanceltype()\n" msgstr "" #. type: SS #: man-pages/man7/pthreads.7:249 #, no-wrap msgid "Cancellation points" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:256 msgid "" "POSIX.1 specifies that certain functions must, and certain other functions " "may, be cancellation points. If a thread is cancelable, its cancelability " "type is deferred, and a cancellation request is pending for the thread, then " "the thread is canceled when it calls a function that is a cancellation point." "" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:259 msgid "" "The following functions are required to be cancellation points by POSIX.1-" "2001 and/or POSIX.1-2008:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:322 #, no-wrap msgid "" "accept()\n" "aio_suspend()\n" "clock_nanosleep()\n" "close()\n" "connect()\n" "creat()\n" "fcntl() F_SETLKW\n" "fdatasync()\n" "fsync()\n" "getmsg()\n" "getpmsg()\n" "lockf() F_LOCK\n" "mq_receive()\n" "mq_send()\n" "mq_timedreceive()\n" "mq_timedsend()\n" "msgrcv()\n" "msgsnd()\n" "msync()\n" "nanosleep()\n" "open()\n" "openat() [Added in POSIX.1-2008]\n" "pause()\n" "poll()\n" "pread()\n" "pselect()\n" "pthread_cond_timedwait()\n" "pthread_cond_wait()\n" "pthread_join()\n" "pthread_testcancel()\n" "putmsg()\n" "putpmsg()\n" "pwrite()\n" "read()\n" "readv()\n" "recv()\n" "recvfrom()\n" "recvmsg()\n" "select()\n" "sem_timedwait()\n" "sem_wait()\n" "send()\n" "sendmsg()\n" "sendto()\n" "sigpause() [POSIX.1-2001 only (moves to \"may\" list in POSIX.1-2008)]\n" "sigsuspend()\n" "sigtimedwait()\n" "sigwait()\n" "sigwaitinfo()\n" "sleep()\n" "system()\n" "tcdrain()\n" "usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]\n" "wait()\n" "waitid()\n" "waitpid()\n" "write()\n" "writev()\n" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:327 msgid "" "The following functions may be cancellation points according to POSIX.1-2001 " "and/or POSIX.1-2008:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:555 #, no-wrap msgid "" "access()\n" "asctime()\n" "asctime_r()\n" "catclose()\n" "catgets()\n" "catopen()\n" "chmod() [Added in POSIX.1-2008]\n" "chown() [Added in POSIX.1-2008]\n" "closedir()\n" "closelog()\n" "ctermid()\n" "ctime()\n" "ctime_r()\n" "dbm_close()\n" "dbm_delete()\n" "dbm_fetch()\n" "dbm_nextkey()\n" "dbm_open()\n" "dbm_store()\n" "dlclose()\n" "dlopen()\n" "dprintf() [Added in POSIX.1-2008]\n" "endgrent()\n" "endhostent()\n" "endnetent()\n" "endprotoent()\n" "endpwent()\n" "endservent()\n" "endutxent()\n" "faccessat() [Added in POSIX.1-2008]\n" "fchmod() [Added in POSIX.1-2008]\n" "fchmodat() [Added in POSIX.1-2008]\n" "fchown() [Added in POSIX.1-2008]\n" "fchownat() [Added in POSIX.1-2008]\n" "fclose()\n" "fcntl() (for any value of cmd argument)\n" "fflush()\n" "fgetc()\n" "fgetpos()\n" "fgets()\n" "fgetwc()\n" "fgetws()\n" "fmtmsg()\n" "fopen()\n" "fpathconf()\n" "fprintf()\n" "fputc()\n" "fputs()\n" "fputwc()\n" "fputws()\n" "fread()\n" "freopen()\n" "fscanf()\n" "fseek()\n" "fseeko()\n" "fsetpos()\n" "fstat()\n" "fstatat() [Added in POSIX.1-2008]\n" "ftell()\n" "ftello()\n" "ftw()\n" "futimens() [Added in POSIX.1-2008]\n" "fwprintf()\n" "fwrite()\n" "fwscanf()\n" "getaddrinfo()\n" "getc()\n" "getc_unlocked()\n" "getchar()\n" "getchar_unlocked()\n" "getcwd()\n" "getdate()\n" "getdelim() [Added in POSIX.1-2008]\n" "getgrent()\n" "getgrgid()\n" "getgrgid_r()\n" "getgrnam()\n" "getgrnam_r()\n" "gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]\n" "gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]\n" "gethostent()\n" "gethostid()\n" "gethostname()\n" "getline() [Added in POSIX.1-2008]\n" "getlogin()\n" "getlogin_r()\n" "getnameinfo()\n" "getnetbyaddr()\n" "getnetbyname()\n" "getnetent()\n" "getopt() (if opterr is nonzero)\n" "getprotobyname()\n" "getprotobynumber()\n" "getprotoent()\n" "getpwent()\n" "getpwnam()\n" "getpwnam_r()\n" "getpwuid()\n" "getpwuid_r()\n" "gets()\n" "getservbyname()\n" "getservbyport()\n" "getservent()\n" "getutxent()\n" "getutxid()\n" "getutxline()\n" "getwc()\n" "getwchar()\n" "getwd() [SUSv3 only (function removed in POSIX.1-2008)]\n" "glob()\n" "iconv_close()\n" "iconv_open()\n" "ioctl()\n" "link()\n" "linkat() [Added in POSIX.1-2008]\n" "lio_listio() [Added in POSIX.1-2008]\n" "localtime()\n" "localtime_r()\n" "lockf() [Added in POSIX.1-2008]\n" "lseek()\n" "lstat()\n" "mkdir() [Added in POSIX.1-2008]\n" "mkdirat() [Added in POSIX.1-2008]\n" "mkdtemp() [Added in POSIX.1-2008]\n" "mkfifo() [Added in POSIX.1-2008]\n" "mkfifoat() [Added in POSIX.1-2008]\n" "mknod() [Added in POSIX.1-2008]\n" "mknodat() [Added in POSIX.1-2008]\n" "mkstemp()\n" "mktime()\n" "nftw()\n" "opendir()\n" "openlog()\n" "pathconf()\n" "pclose()\n" "perror()\n" "popen()\n" "posix_fadvise()\n" "posix_fallocate()\n" "posix_madvise()\n" "posix_openpt()\n" "posix_spawn()\n" "posix_spawnp()\n" "posix_trace_clear()\n" "posix_trace_close()\n" "posix_trace_create()\n" "posix_trace_create_withlog()\n" "posix_trace_eventtypelist_getnext_id()\n" "posix_trace_eventtypelist_rewind()\n" "posix_trace_flush()\n" "posix_trace_get_attr()\n" "posix_trace_get_filter()\n" "posix_trace_get_status()\n" "posix_trace_getnext_event()\n" "posix_trace_open()\n" "posix_trace_rewind()\n" "posix_trace_set_filter()\n" "posix_trace_shutdown()\n" "posix_trace_timedgetnext_event()\n" "posix_typed_mem_open()\n" "printf()\n" "psiginfo() [Added in POSIX.1-2008]\n" "psignal() [Added in POSIX.1-2008]\n" "pthread_rwlock_rdlock()\n" "pthread_rwlock_timedrdlock()\n" "pthread_rwlock_timedwrlock()\n" "pthread_rwlock_wrlock()\n" "putc()\n" "putc_unlocked()\n" "putchar()\n" "putchar_unlocked()\n" "puts()\n" "pututxline()\n" "putwc()\n" "putwchar()\n" "readdir()\n" "readdir_r()\n" "readlink() [Added in POSIX.1-2008]\n" "readlinkat() [Added in POSIX.1-2008]\n" "remove()\n" "rename()\n" "renameat() [Added in POSIX.1-2008]\n" "rewind()\n" "rewinddir()\n" "scandir() [Added in POSIX.1-2008]\n" "scanf()\n" "seekdir()\n" "semop()\n" "setgrent()\n" "sethostent()\n" "setnetent()\n" "setprotoent()\n" "setpwent()\n" "setservent()\n" "setutxent()\n" "sigpause() [Added in POSIX.1-2008]\n" "stat()\n" "strerror()\n" "strerror_r()\n" "strftime()\n" "symlink()\n" "symlinkat() [Added in POSIX.1-2008]\n" "sync()\n" "syslog()\n" "tmpfile()\n" "tmpnam()\n" "ttyname()\n" "ttyname_r()\n" "tzset()\n" "ungetc()\n" "ungetwc()\n" "unlink()\n" "unlinkat() [Added in POSIX.1-2008]\n" "utime() [Added in POSIX.1-2008]\n" "utimensat() [Added in POSIX.1-2008]\n" "utimes() [Added in POSIX.1-2008]\n" "vdprintf() [Added in POSIX.1-2008]\n" "vfprintf()\n" "vfwprintf()\n" "vprintf()\n" "vwprintf()\n" "wcsftime()\n" "wordexp()\n" "wprintf()\n" "wscanf()\n" msgstr "" #. So, scanning "cancellation point" comments in the glibc 2.8 header #. files, it looks as though at least the following nonstandard #. functions are cancellation points: #. endnetgrent #. endspent #. epoll_pwait #. epoll_wait #. fcloseall #. fdopendir #. fflush_unlocked #. fgetc_unlocked #. fgetgrent #. fgetgrent_r #. fgetpwent #. fgetpwent_r #. fgets_unlocked #. fgetspent #. fgetspent_r #. fgetwc_unlocked #. fgetws_unlocked #. fputc_unlocked #. fputs_unlocked #. fputwc_unlocked #. fputws_unlocked #. fread_unlocked #. fwrite_unlocked #. gai_suspend #. getaddrinfo_a #. getdate_r #. getgrent_r #. getgrouplist #. gethostbyaddr_r #. gethostbyname2 #. gethostbyname2_r #. gethostbyname_r #. gethostent_r #. getnetbyaddr_r #. getnetbyname_r #. getnetent_r #. getnetgrent #. getnetgrent_r #. getprotobyname_r #. getprotobynumber_r #. getprotoent_r #. getpw #. getpwent_r #. getservbyname_r #. getservbyport_r #. getservent_r #. getspent #. getspent_r #. getspnam #. getspnam_r #. getutmp #. getutmpx #. getw #. getwc_unlocked #. getwchar_unlocked #. initgroups #. innetgr #. mkostemp #. mkostemp64 #. mkstemp64 #. ppoll #. pthread_timedjoin_np #. putgrent #. putpwent #. putspent #. putw #. putwc_unlocked #. putwchar_unlocked #. rcmd #. rcmd_af #. rexec #. rexec_af #. rresvport #. rresvport_af #. ruserok #. ruserok_af #. setnetgrent #. setspent #. sgetspent #. sgetspent_r #. updwtmpx #. utmpxname #. vfscanf #. vfwscanf #. vscanf #. vsyslog #. vwscanf #. type: Plain text #: man-pages/man7/pthreads.7:653 msgid "" "An implementation may also mark other functions not specified in the " "standard as cancellation points. In particular, an implementation is likely " "to mark any nonstandard function that may block as a cancellation point. " "(This includes most functions that can touch files.)" msgstr "" #. type: SS #: man-pages/man7/pthreads.7:653 #, no-wrap msgid "Compiling on Linux" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:656 msgid "" "On Linux, programs that use the Pthreads API should be compiled using I." msgstr "" #. type: SS #: man-pages/man7/pthreads.7:656 #, no-wrap msgid "Linux implementations of POSIX threads" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:659 msgid "" "Over time, two threading implementations have been provided by the GNU C " "library on Linux:" msgstr "" #. type: TP #: man-pages/man7/pthreads.7:659 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:663 msgid "" "This is the original Pthreads implementation. Since glibc 2.4, this " "implementation is no longer supported." msgstr "" #. type: TP #: man-pages/man7/pthreads.7:663 #, no-wrap msgid "B (Native POSIX Threads Library)" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:671 msgid "" "This is the modern Pthreads implementation. By comparison with " "LinuxThreads, NPTL provides closer conformance to the requirements of the " "POSIX.1 specification and better performance when creating large numbers of " "threads. NPTL is available since glibc 2.3.2, and requires features that " "are present in the Linux 2.6 kernel." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:681 msgid "" "Both of these are so-called 1:1 implementations, meaning that each thread " "maps to a kernel scheduling entity. Both threading implementations employ " "the Linux B(2) system call. In NPTL, thread synchronization " "primitives (mutexes, thread joining, and so on) are implemented using the " "Linux B(2) system call." msgstr "" #. type: SS #: man-pages/man7/pthreads.7:681 #, no-wrap msgid "LinuxThreads" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:683 msgid "The notable features of this implementation are the following:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:690 msgid "" "In addition to the main (initial) thread, and the threads that the program " "creates using B(3), the implementation creates a \"manager\" " "thread. This thread handles thread creation and termination. (Problems can " "result if this thread is inadvertently killed.)" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:702 msgid "" "Signals are used internally by the implementation. On Linux 2.2 and later, " "the first three real-time signals are used (see also B(7)). On " "older Linux kernels, B and B are used. Applications must " "avoid the use of whichever set of signals is employed by the implementation." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:709 msgid "" "Threads do not share process IDs. (In effect, LinuxThreads threads are " "implemented as processes which share more information than usual, but which " "do not share a common process ID.) LinuxThreads threads (including the " "manager thread) are visible as separate processes using B(1)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:712 msgid "" "The LinuxThreads implementation deviates from the POSIX.1 specification in a " "number of ways, including the following:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:716 msgid "Calls to B(2) return a different value in each thread." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:725 msgid "" "Calls to B(2) in threads other than the main thread return the " "process ID of the manager thread; instead B(2) in these threads " "should return the same value as B(2) in the main thread." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:735 msgid "" "When one thread creates a new child process using B(2), any thread " "should be able to B(2) on the child. However, the implementation " "only allows the thread that created the child to B(2) on it." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:742 msgid "" "When a thread calls B(2), all other threads are terminated (as " "required by POSIX.1). However, the resulting process has the same PID as " "the thread that called B(2): it should have the same PID as the main " "thread." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:749 msgid "" "Threads do not share user and group IDs. This can cause complications with " "set-user-ID programs and can cause failures in Pthreads functions if an " "application changes its credentials using B(2) or similar." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:751 msgid "Threads do not share a common session ID and process group ID." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:754 msgid "Threads do not share record locks created using B(2)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:760 msgid "" "The information returned by B(2) and B(2) is per-thread " "rather than process-wide." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:763 msgid "Threads do not share semaphore undo values (see B(2))." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:765 msgid "Threads do not share interval timers." msgstr "" #. FIXME . bug report filed for NPTL nice nonconformance #. http://bugzilla.kernel.org/show_bug.cgi?id=6258 #. Sep 08: there is a patch by Denys Vlasenko to address this #. "make setpriority POSIX compliant; introduce PRIO_THREAD extension" #. Monitor this to see if it makes it into mainline. #. type: Plain text #: man-pages/man7/pthreads.7:767 man-pages/man7/pthreads.7:804 msgid "Threads do not share a common nice value." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:777 msgid "" "POSIX.1 distinguishes the notions of signals that are directed to the " "process as a whole and signals that are directed to individual threads. " "According to POSIX.1, a process-directed signal (sent using B(2), for " "example) should be handled by a single, arbitrarily selected thread within " "the process. LinuxThreads does not support the notion of process-directed " "signals: signals may be sent only to specific threads." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:786 msgid "" "Threads have distinct alternate signal stack settings. However, a new " "thread's alternate signal stack settings are copied from the thread that " "created it, so that the threads initially share an alternate signal stack. " "(A new thread should start with no alternate signal stack defined. If two " "threads handle signals on their shared alternate signal stack at the same " "time, unpredictable program failures are likely to occur.)" msgstr "" #. type: SS #: man-pages/man7/pthreads.7:786 #, no-wrap msgid "NPTL" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:795 msgid "" "With NPTL, all of the threads in a process are placed in the same thread " "group; all members of a thread group share the same PID. NPTL does not " "employ a manager thread. NPTL makes internal use of the first two real-time " "signals (see also B(7)); these signals cannot be used in " "applications." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:797 msgid "NPTL still has at least one nonconformance with POSIX.1:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:806 msgid "Some NPTL nonconformances occur only with older kernels:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:812 msgid "" "The information returned by B(2) and B(2) is per-thread " "rather than process-wide (fixed in kernel 2.6.9)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:814 msgid "Threads do not share resource limits (fixed in kernel 2.6.10)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:816 msgid "Threads do not share interval timers (fixed in kernel 2.6.12)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:820 msgid "" "Only the main thread is permitted to start a new session using B(2) " "(fixed in kernel 2.6.16)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:825 msgid "" "Only the main thread is permitted to make the process into a process group " "leader using B(2) (fixed in kernel 2.6.16)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:831 msgid "" "Threads have distinct alternate signal stack settings. However, a new " "thread's alternate signal stack settings are copied from the thread that " "created it, so that the threads initially share an alternate signal stack " "(fixed in kernel 2.6.16)." msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:833 msgid "Note the following further points about the NPTL implementation:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:847 msgid "" "If the stack size soft resource limit (see the description of " "B in B(2)) is set to a value other than " "I, then this value defines the default stack size for new threads." " To be effective, this limit must be set before the program is executed, " "perhaps using the I shell built-in command (I in " "the C shell)." msgstr "" #. type: SS #: man-pages/man7/pthreads.7:847 #, no-wrap msgid "Determining the threading implementation" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:852 msgid "" "Since glibc 2.3.2, the B(1) command can be used to determine the " "system's threading implementation, for example:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:857 #, no-wrap msgid "bash$ getconf GNU_LIBPTHREAD_VERSION\n" "NPTL 2.3.4\n" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:862 msgid "" "With older glibc versions, a command such as the following should be " "sufficient to determine the default threading implementation:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:868 #, no-wrap msgid "" "bash$ $( ldd /bin/ls | grep libc.so | awk \\(aq{print $3}\\(aq ) | \\e\n" " egrep -i \\(aqthreads|nptl\\(aq\n" " Native POSIX Threads Library by Ulrich Drepper et al\n" msgstr "" #. type: SS #: man-pages/man7/pthreads.7:870 #, no-wrap msgid "Selecting the threading implementation: LD_ASSUME_KERNEL" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:885 msgid "" "On systems with a glibc that supports both LinuxThreads and NPTL (i.e., " "glibc 2.3.I), the B environment variable can be used to " "override the dynamic linker's default choice of threading implementation. " "This variable tells the dynamic linker to assume that it is running on top " "of a particular kernel version. By specifying a kernel version that does " "not provide the support required by NPTL, we can force the use of " "LinuxThreads. (The most likely reason for doing this is to run a (broken) " "application that depends on some nonconformant behavior in LinuxThreads.) " "For example:" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:891 #, no-wrap msgid "" "bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\e\n" " awk \\(aq{print $3}\\(aq ) | egrep -i \\(aqthreads|ntpl\\(aq\n" " linuxthreads-0.10 by Xavier Leroy\n" msgstr "" #. type: SH #: man-pages/man7/pthreads.7:893 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:903 msgid "" "B(2), B(2), B(2), B(5), B(7), " "B(7), B(7)," msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:927 msgid "" "Various Pthreads manual pages, for example: B(3), " "B(3), B(3), B(3), " "B(3), B(3), B(3), " "B(3), B(3), B(3), " "B(3), B(3), B(3), " "B(3), B(3), " "B(3), B(3), " "B(3), B(3), B(3), " "and B(3)" msgstr "" #. type: SH #: man-pages/man7/pthreads.7:927 #, no-wrap msgid "COLOPHON" msgstr "" #. type: Plain text #: man-pages/man7/pthreads.7:935 msgid "" "This page is part of release 3.70 of the Linux I project. A " "description of the project, information about reporting bugs, and the latest " "version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/" "." msgstr ""