12 #ifndef SSTMAC_SOFTWARE_PROCESS_THREAD_H_INCLUDED 13 #define SSTMAC_SOFTWARE_PROCESS_THREAD_H_INCLUDED 77 T* casted =
dynamic_cast<T*
>(a);
80 "Failed to cast API to correct type for %s",
266 perf_counter_impl<T>* pctr =
dynamic_cast<perf_counter_impl<T>*
>(ctr);
269 "failed casting perf_counter type - check perf_model in params");
271 return pctr->counters();
344 spkt_unordered_map<std::string, api*>
apis_;
void add_affinity(int core)
void set_pthread_map(pthread_map_t *threadmap)
virtual app * parent_app() const
process_context get_process_context() const
virtual void run()=0
Derived types need to override this method.
void set_sid(software_id sid)
virtual void init_perf_model_params(sprockit::sim_parameters *params)
static thread * current()
spkt_unordered_map< long, thread * > pthread_map_t
static const task_id main_thread_tid
static const int no_socket_affinity
void * get_tls_value(long thekey) const
void append_backtrace(void *fxn)
friend api * static_get_api(const char *name)
void ** backtrace() const
virtual void remove_variable(void *ptr)=0
perf_counter_model * perf_model_
void set_backtrace(void **bt)
int backtrace_nfxn() const
operating_system * os() const
void * stack_
The stack given to this thread.
The app derived class adds to the thread base class by providing facilities to allow applications to ...
key * schedule_key_
This key gets used by the compute scheduler to delay this thread.
bool is_initialized() const
Test whether the current task has been initialized (activated) by a scheduler.
pthread_map_t * pthread_map_
spkt_unordered_map< std::string, api * > apis_
void unregister_all_libs()
static const int main_thread
A basic container for time (subject to future transplant).
int last_bt_collect_nfxn_
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
T & register_perf_ctr_variable(void *ptr)
void set_tls_value(long thekey, void *ptr)
void cancel()
This thread is not currently active - blocked on something However, some kill event happened and I ne...
size_t stacksize_
The stacksize.
state
Help resolve deadlock situations.
state state_
Monitor state for deadlock detection.
friend class delete_thread_event
void set_cpumask(uint64_t cpumask)
A base type and default (empty) implementation of a handle to block and unblock processes.
std::queue< key * > joiners_
virtual perf_counter * register_variable(void *ptr)=0
std::map< long, void * > tls_values_
perf_counter_model * perf_ctr_model() const
#define spkt_throw_printf(exc, template_str,...)
void register_lib(library *lib)
void set_affinity(int core)
static const app_id main_thread_aid
void cleanup()
This should only ever be invoked by the delete thread event.
key * schedule_key()
key used
static const int no_core_affinity
void collect_backtrace(int nfxn)
virtual std::string to_string() const
threading_interface * context_
#define spkt_throw(exc,...)
std::list< library * > pending_libs_
operating_system * os_
Each thread can only run under one OS/scheduler.
virtual void clear_subthread_from_parent_app()
static const int rdma_thread
int last_backtrace_nfxn() const
void start_thread(thread *thr)
A convenience request to start a new thread.
void init_thread(int phyiscal_thread_id, threading_interface *tocopy, void *stack, int stacksize, operating_system *os, threading_interface *yield_to)
static void run_routine(void *threadptr)
Run routine that defines the initial context for this task.
static const int nic_thread
void set_api(thread *thr)
void set_active_core(int core)
void remove_perf_ctr_variable(void *ptr)
state get_state() const
Get current thread state.
A wrapper for an appid, taskid pair.
virtual api * _get_api(const char *name)
Error indicating some internal value was unexpected.