fairness  v1.0.0
A collection of advanced syncronization mechanisms.
Loading...
Searching...
No Matches
config.hpp File Reference

This file contains configurations about boost and 128bit cpu support. TODO. More...

Include dependency graph for config.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BOOST_FAIRNESS_GETREQUEST_SPINS   1
 The total number of spins performed while performing a getRequest (this is used only if BOOST_FAIRNESS_USE_TATAS is not.
 
#define BOOST_FAIRNESS_GETREQUEST_SPINS_RELAXED   1
 The number of paused spins performed while performing a getRequest (this is used only if BOOST_FAIRNESS_USE_TATAS is not.
 
#define BOOST_FAIRNESS_HARDWARE_DESTRUCTIVE_SIZE   128
 Size to be aligned to avoid false sharing
 
#define BOOST_FAIRNESS_INVALID_PQNODE_INDEX   BOOST_FAIRNESS_MAX_PQNODES
 
#define BOOST_FAIRNESS_INVALID_THREAD_INDEX   BOOST_FAIRNESS_MAX_THREADS
 
#define BOOST_FAIRNESS_MAX_PQNODES   4
 The maximum amount of PQNODES that can be used at the same time per pqspinlock.
Setting this too low may make the mutex less fair (some tests might even fail). Ideally you have 1 PQNODE per thread.
 
#define BOOST_FAIRNESS_MAX_THREADS   4
 Unlike what it may seems this macro does not set the maximum number of supported threads.
Instead this macro tells the library how many thread struct there are per thread/pqspinlock pair to be used.
A good way of seeing it is how many re entrant calls will you make on priority mutexes.
If you plan on using N priority mutexes and locking all of them with the same thread set this number to N.
 
#define BOOST_FAIRNESS_SPINWAIT_SPINS   16
 The total number of spins during a spin_wait operation.
 
#define BOOST_FAIRNESS_SPINWAIT_SPINS_RELAXED   12
 The number of relaxed spins during a spin_wait operation.
 
#define BOOST_FAIRNESS_USE_STD_WAIT_NOTIFY
 boost fairness will use atomic::wait/notify implemented by the standard lib instead of its own implementation by default.
 
#define BOOST_FAIRNESS_WAIT_SPINS   16
 The total number of spins during a wait operation before a syscall to the OS to yield the cpu through futex on linux or waitOnAdress on windows.
 
#define BOOST_FAIRNESS_WAIT_SPINS_RELAXED   12
 The total number of spins during a wait operation before a syscall to the OS to yield the cpu through futex on linux or waitOnAdress on windows.
 

Detailed Description

This file contains configurations about boost and 128bit cpu support. TODO.

Author
F. Abrignani (feder.nosp@m.igno.nosp@m.li@ho.nosp@m.tmai.nosp@m.l.it)
S. Martorana (salva.nosp@m.tore.nosp@m.marto.nosp@m.rana.nosp@m.@hotm.nosp@m.ail..nosp@m.com)
Version
0.1
Date
2023-08-19

Macro Definition Documentation

◆ BOOST_FAIRNESS_GETREQUEST_SPINS

#define BOOST_FAIRNESS_GETREQUEST_SPINS   1

The total number of spins performed while performing a getRequest (this is used only if BOOST_FAIRNESS_USE_TATAS is not.

◆ BOOST_FAIRNESS_GETREQUEST_SPINS_RELAXED

#define BOOST_FAIRNESS_GETREQUEST_SPINS_RELAXED   1

The number of paused spins performed while performing a getRequest (this is used only if BOOST_FAIRNESS_USE_TATAS is not.

◆ BOOST_FAIRNESS_HARDWARE_DESTRUCTIVE_SIZE

#define BOOST_FAIRNESS_HARDWARE_DESTRUCTIVE_SIZE   128

Size to be aligned to avoid false sharing

◆ BOOST_FAIRNESS_INVALID_PQNODE_INDEX

#define BOOST_FAIRNESS_INVALID_PQNODE_INDEX   BOOST_FAIRNESS_MAX_PQNODES

◆ BOOST_FAIRNESS_INVALID_THREAD_INDEX

#define BOOST_FAIRNESS_INVALID_THREAD_INDEX   BOOST_FAIRNESS_MAX_THREADS

◆ BOOST_FAIRNESS_MAX_PQNODES

#define BOOST_FAIRNESS_MAX_PQNODES   4

The maximum amount of PQNODES that can be used at the same time per pqspinlock.
Setting this too low may make the mutex less fair (some tests might even fail). Ideally you have 1 PQNODE per thread.

◆ BOOST_FAIRNESS_MAX_THREADS

#define BOOST_FAIRNESS_MAX_THREADS   4

Unlike what it may seems this macro does not set the maximum number of supported threads.
Instead this macro tells the library how many thread struct there are per thread/pqspinlock pair to be used.
A good way of seeing it is how many re entrant calls will you make on priority mutexes.
If you plan on using N priority mutexes and locking all of them with the same thread set this number to N.

◆ BOOST_FAIRNESS_SPINWAIT_SPINS

#define BOOST_FAIRNESS_SPINWAIT_SPINS   16

The total number of spins during a spin_wait operation.

◆ BOOST_FAIRNESS_SPINWAIT_SPINS_RELAXED

#define BOOST_FAIRNESS_SPINWAIT_SPINS_RELAXED   12

The number of relaxed spins during a spin_wait operation.

◆ BOOST_FAIRNESS_USE_STD_WAIT_NOTIFY

#define BOOST_FAIRNESS_USE_STD_WAIT_NOTIFY

boost fairness will use atomic::wait/notify implemented by the standard lib instead of its own implementation by default.

◆ BOOST_FAIRNESS_WAIT_SPINS

#define BOOST_FAIRNESS_WAIT_SPINS   16

The total number of spins during a wait operation before a syscall to the OS to yield the cpu through futex on linux or waitOnAdress on windows.

◆ BOOST_FAIRNESS_WAIT_SPINS_RELAXED

#define BOOST_FAIRNESS_WAIT_SPINS_RELAXED   12

The total number of spins during a wait operation before a syscall to the OS to yield the cpu through futex on linux or waitOnAdress on windows.