View Issue Details

IDProjectCategoryView StatusLast Update
00003811003.1(2008)/Issue 7Rationalepublic2013-04-16 13:06
ReporterRossPJohnson Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameRoss Johnson
Organization
User Reference
SectionSystem Interfaces - Threads - Thread-Specific Data
Page Number3567 (http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_09)
Line Number120744
Interp Status---
Final Accepted TextSee 0000381:0000694
Summary0000381: Claimed hashability of pthread_t is misleading
DescriptionThe text under model option 1:

<quote>
      No Explicit Support

      A standard thread-specific data interface is not strictly necessary to support applications that require per-thread context. One could, for example, provide a hash function that converted a pthread_t into an integer value that could then be used to index into a global array of per-thread data pointers. This hash function, in conjunction with pthread_self(), would be all the interface required to support a mechanism of this sort. Unfortunately, this technique is cumbersome. It can lead to duplicated code as each set of cooperating modules implements their own per-thread data management schemes.
</quote>

The description claims that pthread_t is hashable.

According to authoritative comments elsewhere, opague pthread_t instances may contain values that are variable between copies and instances. This may be as a result of alignment padding or by design where additional non-thread-identifying values are included to support the implementation.

An application has no knowledge of pthread_t internals and therefore would need to hash over its entire content. As a result, for example, a hash of pthread_t objects returned by successive calls to pthread_self() may return a different result each time.
Desired ActionIf the description is historically based on a previous hashable definition of pthread_t then provide an indication that this model is no longer valid, or remove the entire model option 1 from future editions.
Tagstc1-2008

Activities

drepper

2011-02-17 10:46

reporter   bugnote:0000674

You miss the point of the rationale. It documents what was considered during the writing of the standard. Not everything written in the rationale has any meaning wrt the current standard. In this specific case option 3 was selected for the standard and the other options are just there as an explanation.

nick

2011-03-10 17:23

manager   bugnote:0000694

Last edited: 2011-03-10 17:24

The rationale documents accurately the models that were considered.

Add a new sentence to the end of line 120771:

"Therefore, the third model was chosen."

Also add to 120753:
"This technique would also require that pthread_t not be an opaque type."

eblake

2011-03-10 17:38

manager   bugnote:0000695

This bug deals only with text in the rationale, which will be adjusted
in TC1. Meanwhile, it was noted in the 10 Mar 2011 teleconference that
there was a lot of list traffic debating whether it would also be worth
creating an interface to allow the hashing of pthread_t values; such an
interface proposal should occur as a separate bug report targeting the
next revision of the standard, and should be accompanied with proposed
wording for the requirements on the new interface(s).

Issue History

Date Modified Username Field Change
2011-02-17 00:18 RossPJohnson New Issue
2011-02-17 00:18 RossPJohnson Status New => Under Review
2011-02-17 00:18 RossPJohnson Assigned To => ajosey
2011-02-17 00:18 RossPJohnson Name => Ross Johnson
2011-02-17 00:18 RossPJohnson Section => System Interfaces - Threads - Thread-Specific Data
2011-02-17 00:18 RossPJohnson Page Number => http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_09
2011-02-17 00:18 RossPJohnson Line Number => http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_09
2011-02-17 10:46 drepper Note Added: 0000674
2011-03-10 17:16 nick Page Number http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_09 => 3567 (http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_09)
2011-03-10 17:16 nick Line Number http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_09 => 120744
2011-03-10 17:16 nick Interp Status => ---
2011-03-10 17:23 nick Note Added: 0000694
2011-03-10 17:23 nick Status Under Review => Resolved
2011-03-10 17:23 nick Resolution Open => Accepted As Marked
2011-03-10 17:23 nick Final Accepted Text => See 0000381:0000694
2011-03-10 17:24 nick Note Edited: 0000694
2011-03-10 17:26 nick Tag Attached: tc1-2008
2011-03-10 17:38 eblake Note Added: 0000695
2013-04-16 13:06 ajosey Status Resolved => Closed