|
MADNESS 0.10.1
|
A scalable and fair mutex (not recursive) More...
#include <worldmutex.h>


Public Member Functions | |
| MutexFair () | |
| void | lock () const |
| bool | try_lock () const |
| void | unlock () const |
Private Attributes | |
| int | back |
| int | front |
| int | n |
| volatile bool * | q [MAX_NTHREAD] |
Static Private Attributes | |
| static const int | MAX_NTHREAD = 128 |
Additional Inherited Members | |
Private Member Functions inherited from madness::Spinlock | |
| Spinlock (int junk=0) | |
| Make and initialize a spinlock ... initial state is unlocked. | |
| virtual | ~Spinlock () |
| void | lock () const |
| Acquire the spinlock waiting if necessary. | |
| bool | try_lock () const |
| Try to acquire the spinlock ... return true on success, false on failure. | |
| void | unlock () const |
| Free a spinlock owned by this thread. | |
A scalable and fair mutex (not recursive)
Needs rewriting to use the CV above and do we really need this if using pthread_mutex .. why not pthread_cv?
|
inline |
|
inline |
References b, back, madness::cpu_relax(), madness::Spinlock::lock(), MAX_NTHREAD, n, madness::nonlinear_vector_solver(), q, and madness::Spinlock::unlock().
|
inline |
References madness::Spinlock::lock(), n, madness::nonlinear_vector_solver(), and madness::Spinlock::unlock().
|
inline |
References madness::f, front, madness::Spinlock::lock(), MAX_NTHREAD, n, p(), q, and madness::Spinlock::unlock().
|
mutableprivate |
Referenced by lock(), try_lock(), and unlock().
|
mutableprivate |