60 __thread
unsigned int tid;
109 unsigned int old_counter;
110 unsigned int _local_tid;
114 _local_tid = old_counter + 1;
168 for (i = 0; i < n; i++) {
atomic_t c2
Second synchronization counter.
#define new_thread(entry, arg)
Spawn a new thread.
#define likely(exp)
Optimize the branch as likely taken.
pthread_t tid_t
How do we identify a thread?
#define atomic_read(v)
Read operation on an atomic counter.
void atomic_dec(atomic_t *)
void * arg
Arguments to be passed to start_routine.
Generic thread management facilities.
void barrier_init(barrier_t *b, int t)
This structure is used to call the thread creation helper function.
simulation_configuration rootsim_config
This global variable holds the configuration for the current simulation.
void *(* start_routine)(void *)
A pointer to the entry point of the next-to-be thread.
atomic_t c1
First synchronization counter.
#define to_global_tid(kid, local_tid)
Convert a local tid in a global tid.
Memory Manager main header.
__thread unsigned int tid
bool thread_barrier(barrier_t *b)
int num_threads
Number of threads which will synchronize on the barrier.
void create_threads(unsigned short int n, void *(*start_routine)(void *), void *arg)
bool iCAS(volatile uint32_t *ptr, uint32_t oldVal, uint32_t newVal)
#define thread_barrier_reset(b)
Reset operation on a thread barrier.
static void * __helper_create_thread(void *arg)
int atomic_inc_and_test(atomic_t *v)
__thread unsigned int local_tid
bool core_binding
Bind threads to specific core (reduce context switches and cache misses)
static unsigned int thread_counter
static void set_affinity(int core)
#define unlikely(exp)
Optimize the branch as likely not taken.
unsigned int kid
Identifier of the local kernel.
Thread barrier definition.