A sharer is a thread responsible for executing a list of SharingStrategies.
More...
#include <Sharer.hpp>
|
| Sharer (int id_, std::vector< std::shared_ptr< SharingStrategy > > &sharingStrategies) |
| Constructor with multiple sharing strategies.
|
|
| Sharer (int id_, std::shared_ptr< SharingStrategy > sharingStrategy) |
| Constructor with a single sharing strategy.
|
|
virtual | ~Sharer () |
| Destructor.
|
|
virtual void | printStats () |
| Print sharing statistics.
|
|
void | join () |
| Join the thread of this sharer object.
|
|
void | setThreadAffinity (int coreId) |
| Set the thread affinity for this sharer.
|
|
int | getId () |
| Get the ID of this sharer.
|
|
void | setId (int id) |
| Set the ID of this sharer.
|
|
|
Thread * | sharer |
| Pointer to the thread in charge of sharing.
|
|
double | totalSharingTime = 0 |
| Heuristic for strategy implementation comparison (TODO: ifndef NSTAT for such probes)
|
|
unsigned int | round |
| Number of sharing rounds completed.
|
|
std::vector< std::shared_ptr< SharingStrategy > > | sharingStrategies |
| Strategy/Strategies used to share clauses.
|
|
int | m_sharerId |
| The ID of this sharer.
|
|
|
void * | mainThrSharing (void *arg) |
| Working function that will call sharingStrategy doSharing()
|
|
A sharer is a thread responsible for executing a list of SharingStrategies.
◆ Sharer() [1/2]
Sharer::Sharer |
( |
int | id_, |
|
|
std::vector< std::shared_ptr< SharingStrategy > > & | sharingStrategies ) |
Constructor with multiple sharing strategies.
- Parameters
-
id_ | The ID of the sharer. |
sharingStrategies | A vector of sharing strategies. |
◆ Sharer() [2/2]
Sharer::Sharer |
( |
int | id_, |
|
|
std::shared_ptr< SharingStrategy > | sharingStrategy ) |
Constructor with a single sharing strategy.
- Parameters
-
id_ | The ID of the sharer. |
sharingStrategy | A single sharing strategy. |
◆ getId()
Get the ID of this sharer.
- Returns
- The sharer's ID.
◆ setId()
void Sharer::setId |
( |
int | id | ) |
|
|
inline |
Set the ID of this sharer.
- Parameters
-
id | The new ID for the sharer. |
◆ setThreadAffinity()
void Sharer::setThreadAffinity |
( |
int | coreId | ) |
|
|
inline |
Set the thread affinity for this sharer.
- Parameters
-
coreId | The ID of the core to set affinity to. |
◆ mainThrSharing
void * mainThrSharing |
( |
void * | arg | ) |
|
|
friend |
Working function that will call sharingStrategy doSharing()
- Parameters
-
- Returns
- NULL if well ended
- Parameters
-
arg | Pointer to the associated Sharer object. |
- Returns
- NULL if the thread exits correctly.
The documentation for this class was generated from the following file: