| To: | yyyyyyy@xxxxxxxxxx |
|---|---|
| Subject: | Re: Defect in XSH pthread_attr_getscope() |
| From: | Dave Butenhof <yyyyyyyyyyyyyy@xxxxxx> |
| Date: | Thu, 13 Feb 2003 06:50:35 -0500 |
| Cc: | yyyyyyyyyyyyyyy@xxxxxxxxxxxxx |
| Organization: | Hewlett-Packard Company |
| References: | <200302130943.JAA17607@xxxxxx> |
yyyyyyy@xxxxxxxxxx wrote: Again, this is deliberately unspecified. The standard, first off,
requires only that AT LEAST ONE of the two defined scheduling contention
scopes be implemented. Specifying the default would conflict with that
flexibility. (We might consider requiring that IF the implementation
provides only ONE of the two contention scopes, then it must default the
attribute to the one it defines. In POSIX this sort of issue was
generally considered "quality of implementation" rather than something
to be mandated by the standard, though.)Oh, and, by the way, the standard doesn't actually say that the "default value" must be one of the defined constants for these attributes. On Solaris, for example, the default stack size is 0. Since nobody can legally set a value of 0, pthread_create() knows to replace the value 0 with the actual stack size. This has the annoying side effect that one cannot fetch and perform computations on the default (e.g., to run with 1/2, or twice, the default), but it's not illegal. Similarly, it'd be legal (if odd) for the default contention scope value to be "0", while system and process were defined to 1 and 2, so that pthread_create() could distinguish and supply the true default. POSIX simply doesn't have enough constraints to support 'get' operations on any of these attributes until they have been set by the application. I found this unfortunate when I discovered it, but I suppose I've gotten over it. "Late binding" does provide some advantages, after all. -- /--------------------[ yyyyyyyyyyyyyy@xxxxxx ]--------------------\ | Hewlett-Packard Company Tru64 UNIX & VMS Thread Architect | | My book: http://www.awl.com/cseng/titles/0-201-63392-2/ | \----[ http://homepage.mac.com/dbutenhof/Threads/Threads.html ]---/ |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Defect in XSH pthread_attr_getschedpolicy(), Dave Butenhof |
|---|---|
| Next by Date: | Re: Defect in XSH pthread_attr_getinheritsched(), Ulrich Drepper |
| Previous by Thread: | Defect in XSH pthread_attr_getscope(), drepper |
| Next by Thread: | Defect in XSH pthread_mutex_lock(), drepper |
| Indexes: | [Date] [Thread] [All Lists] |