RTI Connext Traditional C++ API  Version 6.1.2

Other Utilities APIs. More...

Static Public Member Functions

static void sleep (const struct DDS_Duration_t &durationIn)
 Block the calling thread for the specified duration. More...
 
static void spin (DDS_UnsignedLongLong spinCount)
 Performs the spin operation as many times as indicated. More...
 
static DDS_UnsignedLongLong get_spin_per_microsecond ()
 Returns the number of spin operations to perform to wait 1 microsecond. More...
 
static DDS_Boolean enable_heap_monitoring ()
 [DEPRECATED] See: NDDSUtilityHeapMonitoring::enable. More...
 
static void disable_heap_monitoring ()
 [DEPRECATED] See: NDDSUtilityHeapMonitoring::disable. More...
 
static DDS_Boolean pause_heap_monitoring ()
 [DEPRECATED] See: NDDSUtilityHeapMonitoring::pause. More...
 
static DDS_Boolean resume_heap_monitoring ()
 [DEPRECATED] See: NDDSUtilityHeapMonitoring::resume More...
 
static DDS_Boolean take_heap_snapshot (const char *filename, DDS_Boolean print_details)
 [DEPRECATED] See: NDDSUtilityHeapMonitoring::take_heap_snapshot. More...
 

Detailed Description

Other Utilities APIs.

Member Function Documentation

◆ sleep()

static void NDDSUtility::sleep ( const struct DDS_Duration_t durationIn)
static

Block the calling thread for the specified duration.

Note that the achievable resolution of sleep is OS-dependent. That is, do not assume that you can sleep for 1 nanosecond just because you can specify a 1-nanosecond sleep duration via the API. The sleep resolution on most operating systems is usually 10 ms or greater.

Parameters
durationIn<<in>> Sleep duration.
MT Safety:
safe
Examples:
HelloWorld_publisher.cxx.

◆ spin()

static void NDDSUtility::spin ( DDS_UnsignedLongLong  spinCount)
static

Performs the spin operation as many times as indicated.

Spinning is the action of performing useless operations in a for loop in order to actively wait some time without yielding the CPU. Given that the resolution of sleep is in the order of ms, you can use this utility to wait times in the order of microseconds. To properly use this functionality, it is useful to measure previously the number of spin operations needed to wait the equivalent to microsecond (using the utility get_spin_per_microsecond) and then compute the corresponding spin count desired.

Parameters
spinCount<<in>> Number of spin operations to perform.

◆ get_spin_per_microsecond()

static DDS_UnsignedLongLong NDDSUtility::get_spin_per_microsecond ( )
static

Returns the number of spin operations to perform to wait 1 microsecond.

This utility can be used to measure how many spin operations must be performed to wait 1 microsecond. Since the time that it takes the CPU to perform 1 spin operation depends on the CPU frequency, it is recommended to use this utility before using spin().

Returns
Number of spin operations to wait 1 microsecond.
See also
NDDSUtility::spin

◆ enable_heap_monitoring()

static DDS_Boolean NDDSUtility::enable_heap_monitoring ( )
static

◆ disable_heap_monitoring()

static void NDDSUtility::disable_heap_monitoring ( )
static

◆ pause_heap_monitoring()

static DDS_Boolean NDDSUtility::pause_heap_monitoring ( )
static

◆ resume_heap_monitoring()

static DDS_Boolean NDDSUtility::resume_heap_monitoring ( )
static

◆ take_heap_snapshot()

static DDS_Boolean NDDSUtility::take_heap_snapshot ( const char *  filename,
DDS_Boolean  print_details 
)
static