View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000314 | 1003.1(2004)/Issue 6 | System Interfaces | public | 2010-09-17 08:10 | 2013-04-16 13:06 |
Reporter | ajosey | Assigned To | ajosey | ||
Priority | normal | Severity | Objection | Type | Error |
Status | Closed | Resolution | Accepted | ||
Name | Andrew Josey | ||||
Organization | The Open Group | ||||
User Reference | XSHbug2.txt Enhancement Request Number 230 | ||||
Section | pthread_attr_getscope | ||||
Page Number | 1008 | ||||
Line Number | 32256 | ||||
Interp Status | Approved | ||||
Final Accepted Text | 0000314:0000551 | ||||
Summary | 0000314: pthread_attr_setscope pa_setscope ENOTSUP | ||||
Description | The ENOTSUP error for pthread_attr_setscope() is currently listed as "may fail". Thus when the scope value is unsupported, implementations are allowed either to fail, or to succeed and set the unsupported scope value in the attributes. Presumably in the latter case the expectation is that pthread_create() would fail, but there is no error number specified for pthread_create() for this case. Implementations could return a different error from those listed for pthread_create() (the obvious choice being ENOTSUP), but this would create a problem for applications, as they would not have a portable way to determine whether a particular contention scope is supported or not. The issue also affects pthread_attr_setschedparam(), pthread_attr_setschedpolicy() and (to a lesser extent) pthread_attr_setinheritsched(). (For pthread_attr_setinheritsched() the only possible valid-but-unsupported values are non-standard ones, so the problem of portable applications determining support does not occur. However, for consistency it should be dealt with in the same was as the others.) The problem could be addressed either by changing the pthread_attr_set*() ENOTSUP errors to "shall fail" or by adding an ENOTSUP error for pthread_create(). The former is preferred, as the latter would not identify which attribute is the one that is unsupported, and it would mean existing applications that check for an ENOTSUP error from pthread_attr_set*() functions would need to be updated to check for the new pthread_create() ENOTSUP as well. Changing the "may fail" ENOTSUP errors to "shall fail" would also be consistent with pthread_mutexattr_setprotocol() where it is "shall fail". There is also a related problem with pthread_setschedparam() and pthread_setschedprio(). Here there is no excuse for the ENOTSUP errors being "may fail" as the functions act on threads that have already been created, so detection of the error cannot be deferred as it could with the pthread_attr_set*() functions. For pthread_setschedprio() I am also wondering why the ENOTSUP error exists at all. The range of valid priorities for a given scheduling policy can be obtained from sched_get_priority_max/min(). Values outside this range should produce an EINVAL error (if the error is detected at all). Is it really the intention that some values within the valid range could be unsupported? If so, there would seem to be no point in XSH6 section 2.8.4 specifying that SCHED_FIFO, SCHED_RR and SCHED_SPORADIC must have a priority range of at least 32 distinct priorities, as implementations could have sched_get_priority_max() - sched_get_priority_min() >= 32 but only "support" fewer than 32 priorities by giving an ENOTSUP error when an application tries to use the others. I think this ENOTSUP error should be removed. This defect report needs to be sent down the interpretations track in order to ensure that it is in scope for the revision. | ||||
Desired Action | Insert before line 32253: "The pthread_attr_setscope() function shall fail if:" Move the ENOTSUP error from line 32256 to after this new line. Insert before page 1002 line 32078: "The pthread_attr_setinheritsched() function shall fail if:" Move the ENOTSUP error from line 32082 to after this new line. Insert before page 1004 line 32142: "The pthread_attr_setschedparam() function shall fail if:" Move the ENOTSUP error from line 32145 to after this new line. Insert before page 1006 line 32194: "The pthread_attr_setschedpolicy() function shall fail if:" Move the ENOTSUP error from line 32197 to after this new line. Insert before page 1077 line 34045: "The pthread_setschedparam() function shall fail if:" Move the two ENOTSUP errors from lines 34084-34051 to after this new line. At page 1152 line 36219 delete the ENOTSUP error. | ||||
Tags | tc1-2008 |
|
Published as Austin Group Interpretation reference 1003.1-2001 #212 https://www.opengroup.org/austin/interps/uploads/40/16009/AI-212.txt Interpretation response ------------------------ The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor. Rationale: ------------- None. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- See the desired action field. This is targeted for TC1 |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-09-17 08:10 | ajosey | New Issue | |
2010-09-17 08:10 | ajosey | Status | New => Under Review |
2010-09-17 08:10 | ajosey | Assigned To | => ajosey |
2010-09-17 08:10 | ajosey | Name | => Andrew Josey |
2010-09-17 08:10 | ajosey | Organization | => The Open Group |
2010-09-17 08:10 | ajosey | User Reference | => XSHbug2.txt Enhancement Request Number 230 |
2010-09-17 08:10 | ajosey | Section | => pthread_attr_getscope |
2010-09-17 08:10 | ajosey | Page Number | => 1008 |
2010-09-17 08:10 | ajosey | Line Number | => 32256 |
2010-09-17 08:10 | ajosey | Interp Status | => --- |
2010-09-17 08:11 | ajosey | Interp Status | --- => Approved |
2010-09-17 08:11 | ajosey | Note Added: 0000551 | |
2010-09-17 08:11 | ajosey | Status | Under Review => Interpretation Required |
2010-09-17 08:11 | ajosey | Resolution | Open => Accepted |
2010-09-17 08:13 | ajosey | Final Accepted Text | => 0000314:0000551 |
2010-09-17 08:13 | ajosey | Tag Attached: tc1-2008 | |
2010-09-17 08:15 | ajosey | Note Edited: 0000551 | |
2013-04-16 13:06 | ajosey | Status | Interpretation Required => Closed |