[Bug libc/6399] gettid() should have a wrapper
bugdal at aerifal dot cx
sourceware-bugzilla@sourceware.org
Fri Oct 9 19:42:00 GMT 2015
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.
More information about the Glibc-bugs
mailing list