* pthread_self.3: arith type or structure
@ 2009-11-06 0:59 Jan Engelhardt
[not found] ` <alpine.LSU.2.00.0911060158001.12689-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2009-11-06 0:59 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
Hi,
in man-pages 3.23, one can read in pthread_self.3:
"POSIX.1 allows an implementation wide freedom in choosing the type
used to represent a thread ID; for example, representation using
either an arithmetic type or a structure is permitted."
http://opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
however mentions "all of the types are defined as arithmetic types".
Would you know which of the two documentations (linux-man-pages,
opengroup's website) is correct?
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: pthread_self.3: arith type or structure
[not found] ` <alpine.LSU.2.00.0911060158001.12689-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
@ 2009-11-06 21:50 ` bill o gallmeister
[not found] ` <4AF49A0E.6080004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: bill o gallmeister @ 2009-11-06 21:50 UTC (permalink / raw)
To: Jan Engelhardt
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
Jan Engelhardt wrote:
> in man-pages 3.23, one can read in pthread_self.3:
>
>
> "POSIX.1 allows an implementation wide freedom in choosing the type
> used to represent a thread ID; for example, representation using
> either an arithmetic type or a structure is permitted."
>
> http://opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
> however mentions "all of the types are defined as arithmetic types".
> Would you know which of the two documentations (linux-man-pages,
> opengroup's website) is correct?
It depends on which spec the implementation conforms to. An Opengroup conformant
system would need to provide an arithmetic type, whereas an IEEE 1003.1c-1995
conformant system could get away with a more relaxed specification of pthread_t.
I can speak to the POSIX spec for pthread_t. The idea was to allow it to be
implemented as any sort of type; hence the provision of pthread_equal() to
compare two pthread_t variables.
The opengroup spec would seem to have specified this further (the pthreads spec
is from 1995 and the Opengroup spec says 1997). I am not sure why that would be.
If you're an application programmer, I would advise you to assume that pthread_t
is not an arithmetic type. On the other hand, I have yet to see an implementation
where it is not some sort of integer or pointer.
- bog
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: pthread_self.3: arith type or structure
[not found] ` <4AF49A0E.6080004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2009-11-06 22:05 ` Jan Engelhardt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2009-11-06 22:05 UTC (permalink / raw)
To: bill o gallmeister
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
On Friday 2009-11-06 22:50, bill o gallmeister wrote:
>
>> in man-pages 3.23, one can read in pthread_self.3:
>>
>>
>> "POSIX.1 allows an implementation wide freedom in choosing the type
>> used to represent a thread ID; for example, representation using
>> either an arithmetic type or a structure is permitted."
>>
>> http://opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
>> however mentions "all of the types are defined as arithmetic types".
>> Would you know which of the two documentations (linux-man-pages,
>> opengroup's website) is correct?
>
>It depends on which spec the implementation conforms to. An Opengroup conformant
>system would need to provide an arithmetic type, whereas an IEEE 1003.1c-1995
>conformant system could get away with a more relaxed specification of pthread_t.
>
>I can speak to the POSIX spec for pthread_t. The idea was to allow it to be
>implemented as any sort of type; hence the provision of pthread_equal() to
>compare two pthread_t variables.
I picked up the pthread_t discussion from a bit of IRC.
Later message exchanges mentioned that the specification was changed
already again in POSIX.1-2004 to make pthread_t the one exception
to the arithmetic rule; other than that, I also hear that OS_X
makes pthread_t a pointer type.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-06 22:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-06 0:59 pthread_self.3: arith type or structure Jan Engelhardt
[not found] ` <alpine.LSU.2.00.0911060158001.12689-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2009-11-06 21:50 ` bill o gallmeister
[not found] ` <4AF49A0E.6080004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-11-06 22:05 ` Jan Engelhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox