This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6399] gettid() should have a wrapper
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 09 Oct 2015 19:41:53 +0000
- Subject: [Bug libc/6399] gettid() should have a wrapper
- Auto-submitted: auto-generated
- References: <bug-6399-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=6399
--- Comment #46 from Rich Felker <bugdal at aerifal dot cx> ---
In response to comment 44, there is nothing racy about tids as long as they are
only used from within the process they belong to. A tid's lifetime cannot
asynchronously end; only pthread_exit (or SYS_exit at the syscall level) can
end it, and this is fully under application control. Process ids, on the other
hand, are racy.
In response to comment 42, from a glibc standpoint that's pretty much all Linux
implementation details. There is no reason for portable applications that want
to use thread-directed sigevent delivery, etc. to care that tids happen to be
allocated in a common namespace with pids, that the initial thread's tid is
equal to its pid, etc. Adopting these conventions as part of a public interface
is an option, but one which potentially constrains future directions, and the
pros and cons should be weighed.
--
You are receiving this mail because:
You are on the CC list for the bug.