This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
AW: AW: AW: RFC: POSIX timers and threads in a realtime context
- From: "Warlich, Christof" <christof dot warlich at siemens dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Rich Felker <dalias at libc dot org>, Zack Weinberg <zackw at panix dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "Sudler, Simon" <simon dot sudler at siemens dot com>, "Hartmann, Wolfgang" <wolfgang dot hartmann at siemens dot com>
- Date: Wed, 7 Oct 2015 11:48:56 +0000
- Subject: AW: AW: AW: RFC: POSIX timers and threads in a realtime context
- Authentication-results: sourceware.org; auth=none
- References: <6D83E89737156549AEA25EF9ED712C5D158489 at DEFTHW99EK1MSX dot ww902 dot siemens dot net> <20151005160303 dot GK8645 at brightrain dot aerifal dot cx> <6D83E89737156549AEA25EF9ED712C5D1585ED at DEFTHW99EK1MSX dot ww902 dot siemens dot net> <alpine dot DEB dot 2 dot 10 dot 1510061203190 dot 4225 at digraph dot polyomino dot org dot uk> <6D83E89737156549AEA25EF9ED712C5D15885D at DEFTHW99EK1MSX dot ww902 dot siemens dot net> <alpine dot DEB dot 2 dot 10 dot 1510071042570 dot 7103 at digraph dot polyomino dot org dot uk>
Joseph Myers wrote:
> Losing the context is kind of the point.
>
> (a) Adding a new function requires more careful consideration than adding
> a new constant for an existing function; it must be maximally clear to
> readers of libc-alpha if a new function is being proposed.
Ok, but isn't adding a constant (i.e. SIGEV_PTHREAD_ID) the favorable
path to go anyway?
> (b) Different people may be interested in gettid interfaces from different
> contexts and a new thread helps attract those people.
Maybe, but a gettid() wrapper does not help with my point at all, so I don't
want to mix this issue into the current discussion.
> > been done before introducing the already existing GLIBC interfaces that
> > do already require kernel tids?
>
> I'm not sure anyone realised the issue when adding the interfaces. In any
> case, glibc did not have a community and consensus based decision making
> process at that time; it does now.
I'm sure everyone appreciates that it does now :-).
> > From the follow-up discussion between Joseph, Rich and Zack, I take that
> > a Linux-only approach to expose the kernel tid by inspecting struct
> > pthread would not be acceptable and that amending timer_create() with
> > SIGEV_PTHREAD_ID would have far better chances to be accepted. If
> > starting a new thread on the topic is the way to proceed, I'd like to
> > start that thread by only considering that remaining option, i.e.
> > amending timer_create() with SIGEV_PTHREAD_ID. Could we agree on this?
>
> Is SIGEV_PTHREAD_ID supposed to be in the same namespace of values as the
> other SIGEV_* constants? If so, that is a namespace controlled by the
> Linux kernel, and it would not be possible to add support for a new
> constant to glibc without getting the Linux kernel to reserve the value
> glibc will be using. Such reservations have proved hard to achieve in the
> past (see: Rich's attempt to reserve values for O_SEARCH and O_EXEC), but
> it may be easier for something where there is a clear reason the semantics
> have to be implemented in userspace.
Ok, good point: I'm not sure what you exactly mean by "namespace" though,
But as the SIGEV_* macros definitely need to share a common value space,
there seems to be no way getting around convincing the Linux kernel to
reserve a new value (in include/uapi/asm-generic/siginfo.h) if one wants to go
the SIGEV_PTHREAD_ID path.
But anyhow, since you are certainly right that this would be hard to achieve,
a very helpful prerequisite would be to have a consensus within the GLIBC
community that this is the way to go.