ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ttg::detail::MemoryWatchpoint_x86_64::Pool Class Reference

a singleton pool of MemoryWatchpoint objects More...

#include <bug.h>

Public Member Functions

 ~Pool ()=default
 
Poolset (void *addr, Size size, Condition cond, const pthread_t *thread)
 
MemoryWatchpoint_x86_64find (void *addr, const pthread_t *thread)
 
Poolclear (void *addr, const pthread_t *thread)
 

Static Public Member Functions

static void initialize_instance (const std::vector< const pthread_t * > &threads)
 
static std::shared_ptr< Poolinstance ()
 accesses the unique pool; asserts that the default instance has been initialized by calling initialize()
 

Static Public Attributes

static constexpr const size_t nwatchpoints_per_thread = 4
 

Detailed Description

a singleton pool of MemoryWatchpoint objects

Definition at line 80 of file bug.h.

Constructor & Destructor Documentation

◆ ~Pool()

ttg::detail::MemoryWatchpoint_x86_64::Pool::~Pool ( )
default

Member Function Documentation

◆ clear()

Pool & ttg::detail::MemoryWatchpoint_x86_64::Pool::clear ( void *  addr,
const pthread_t *  thread 
)
inline

Clear a watchpoint

Parameters
addraddress that is watched
threadpointer to the pthread_t

Definition at line 143 of file bug.h.

◆ find()

MemoryWatchpoint_x86_64 * ttg::detail::MemoryWatchpoint_x86_64::Pool::find ( void *  addr,
const pthread_t *  thread 
)
inline

Find watchpoint in thread thread and pointing to addr

Parameters
addrbase address to watch
threadpointer to the pthread_t
Returns
the pointer to the MemoryWatchpoint object; nullptr if such a watchpoint does not exist

Definition at line 131 of file bug.h.

◆ initialize_instance()

static void ttg::detail::MemoryWatchpoint_x86_64::Pool::initialize_instance ( const std::vector< const pthread_t * > &  threads)
inlinestatic

Constructs the unique pool from a set of thread IDs

Parameters
threadsa vector of pthread_t obtained via pthread_self (for the main thread) and pthread_create for other threads; only pointers to these unique objects can be used in subsequent calls.

Definition at line 90 of file bug.h.

Here is the caller graph for this function:

◆ instance()

static std::shared_ptr< Pool > ttg::detail::MemoryWatchpoint_x86_64::Pool::instance ( )
inlinestatic

accesses the unique pool; asserts that the default instance has been initialized by calling initialize()

Definition at line 95 of file bug.h.

Here is the caller graph for this function:

◆ set()

Pool & ttg::detail::MemoryWatchpoint_x86_64::Pool::set ( void *  addr,
Size  size,
Condition  cond,
const pthread_t *  thread 
)
inline

Sets a watchpoint in thread thread and pointing to size bytes starting at addr if cond holds

Parameters
addrbase address to watch
sizehow many bytes to watch starting at address addr
condcondition that need to hold to trigger the watchpoint
threadpthread_t object
Exceptions
std::runtime_errorif setting memory watchpoint failed
Returns
reference to this

Definition at line 108 of file bug.h.

Here is the call graph for this function:

Member Data Documentation

◆ nwatchpoints_per_thread

constexpr const size_t ttg::detail::MemoryWatchpoint_x86_64::Pool::nwatchpoints_per_thread = 4
staticconstexpr

Definition at line 82 of file bug.h.


The documentation for this class was generated from the following file: