Instance Class Reference

HiCR: HiCR::backend::pthreads::Instance Class Reference
HiCR
HiCR::backend::pthreads::Instance Class Reference

#include <instance.hpp>

Inheritance diagram for HiCR::backend::pthreads::Instance:
HiCR::Instance

Public Member Functions

 Instance (const instanceId_t instanceId, const pthread_t pthreadId, const instanceId_t rootInstanceId)
 
 ~Instance ()=default
 
bool isRootInstance () const override
 
pthread_t getPthreadId () const
 
- Public Member Functions inherited from HiCR::Instance
__INLINE__ instanceId_t getId () const
 

Additional Inherited Members

- Public Types inherited from HiCR::Instance
using instanceId_t = uint64_t
 
- Protected Member Functions inherited from HiCR::Instance
__INLINE__ Instance (instanceId_t id)
 

Detailed Description

Implementation of the HiCR Instance

Constructor & Destructor Documentation

◆ Instance()

HiCR::backend::pthreads::Instance::Instance ( const instanceId_t  instanceId,
const pthread_t  pthreadId,
const instanceId_t  rootInstanceId 
)
inline

Constructor

Parameters
[in]instanceIdthe id of the instance
[in]pthreadIdthe pthread id
[in]rootInstanceIdthe id of root

◆ ~Instance()

HiCR::backend::pthreads::Instance::~Instance ( )
virtualdefault

Default destructor

Reimplemented from HiCR::Instance.

Member Function Documentation

◆ getPthreadId()

pthread_t HiCR::backend::pthreads::Instance::getPthreadId ( ) const
inline

Getter for pthread id

Returns
ptread id

◆ isRootInstance()

bool HiCR::backend::pthreads::Instance::isRootInstance ( ) const
inlineoverridevirtual

This function reports whether the caller is the root instance

The root instance represents a single instance in the entire deployment with the following characteristics:

  • It is unique. Only a single instance shall be root in the entire deployment, even if new ones are created.
  • It belongs among the first set of instances created during launch time
  • It has no parent instance

The purpose of the root instance is to provide the minimal tiebreak mechanism that helps in role/task distribution.

Note
Each backend decides how to designate the root instance. Hence, this is a pure virtual function.
Returns
True, if the current instance is root; false, otherwise.

Implements HiCR::Instance.


The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/backends/pthreads/instance.hpp