|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 2124 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 2124.
Report 2124 Actions
Problem Report Number 2124 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.1089 Raised 2001-02-07 08:00 Updated 2003-03-13 08:00 Published 2001-03-15 08:00 Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98) Certification Program The Open Brand certification program Test Suite VSTH version 5.2.1 Test Identification PTHR.os/mutexattr_rt/pthread_mutexattr_setprotocol 5 Problem Summary TSD5TH.00086 This is a resubmit of PG5TH.0001. The reason for the test failure is the test does a pthread_cond_broadcast() and then expects the threads waiting on the mutex to acquire it in priority order. Accordi... Problem Text
This is a resubmit of PG5TH.0001.
The reason for the test failure is the test does a
pthread_cond_broadcast() and then expects the threads waiting on the
mutex to acquire it in priority order.
According to System Interfaces and Headers, Issue 5:
"The pthread_cond_broadcast() call unblocks all threads currently
blocked on the specified condition variable cond.
If more than one thread is blocked on a condition variable, the
scheduling policy determines the order in which threads are
unblocked. When each unblocked as a result of pthread_cond_signal()
or pthread_cond_broadcast() returns from its call to
pthread_cond_wait() or pthread_cond_timedwait(), the threads owns the
mutex with which it called pthread_cond_wait() or
pthread_cond_timedwait(). The thread(s) that are unblocked contend
for the mutex according to the scheduling policy (if applicable),
and as if each had called pthread_mutex_lock()."
According to POSIX.1c Standard Section 11.4.3.2:
"pthread_cond_broadcast() unblocks all threads currently blocked , and if more
that one thread is blocked on a condition variable, the scheduling policy
determines the order in which threads are unblocked."
Even if unblocked in priority order, on an machine with X processors,
the top X priority threads could all be set running simultaneously
and so a race condition to acquire the mutex occurs. The test assumes
that the higher priority thread will run before the lower priority
thread, and hence reach the mutex and acquire it before the other
thread. This would be true on a uniprocessor or if the library only
used one CPU. It is false on a multiprocessor when the library uses
all available CPUs.
The standard recognizes the existence of such race conditions, else it
would not provide for a priority inheritence mutex protocol attribute
(PTHREAD_PRIO_INHERIT) to deal with cases where it matters to the
application.Test Output
************************************************************************
/tset/PTHR.os/mutexattr_rt/pthread_mutexattr_setprotocol/T.pthread_mutex
attr_setprotocol 5 Failed
Test Information:
When a thread owns a mutex whose protocol attribute
has been set to a value of PTHREAD_PRIO_NONE,
then its priority and scheduling are not affected by
its mutex ownership.
Posix Ref: Component PTHREAD_MUTEXATTR_SETPROTOCOL
Assertion 9945-1:1996 13.6.1.2-5(A)
************************************************************************Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
A test suite deficiency is recommended
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
Problem Reporting System Options:
- View Report 2124
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority