This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6399] gettid() should have a wrapper


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]