82 #if (LUSH_PTHR_FN_TY == 3) 83 # define lushPthr_memSizeElem (5 * 1024 * 1024) 85 # define lushPthr_memSizeElem (0) 91 #define lushPthr_memSize (sizeof(lushPthr_mem)) 92 #define lushPthr_memSizeMax (0x3fffffff) 101 atomic_long DBG_numLockAcq = 0;
103 atomic_long DBG_numLockAlloc = 0;
105 atomic_long DBG_maxLockAllocCur = 0;
106 atomic_long DBG_numLockFreelistCur = 0;
162 sizeof(lushPtr_SyncObjData_t));
171 + (HOST_CACHE_LINE_SZ - 1))
172 & (uintptr_t)~(HOST_CACHE_LINE_SZ - 1)),
175 #if (LUSH_PTHR_FN_TY == 3) 177 if ( !(
sizeof(pthread_spinlock_t) == 4) ) {
178 hpcrun_abort(
"LUSH Pthreads found unexpected pthread_spinlock_t type!");
192 x->is_working =
false;
196 x->doIdlenessCnt = 0;
200 x->ps_num_procs = &globals.ps_num_procs;
203 x->ps_num_working = &globals.ps_num_working;
204 x->ps_num_working_lock = &globals.ps_num_working_lock;
206 x->ps_num_idle_cond = &globals.ps_num_idle_cond;
214 x->syncObjData =
NULL;
216 x->cache_syncObj =
NULL;
217 x->cache_syncObjData =
NULL;
219 x->freelstHead =
NULL;
220 x->freelstTail =
NULL;
227 #if (LUSH_PTHR_FN_TY == 3) 228 int lckval = (
lock) ? *((
int*)
lock) : 0;
232 lushval = data->lock.spin;
234 EMSG(
"lushPthr/%s:\t lck: %p->%#x->%d", nm, lock, lckval, lushval);
236 EMSG(
"lushPthr/%s:\t is_wrking %d, num_lck %d, cnd_lck %d | " 237 "# wrking %ld, wrking_lck %ld, idle_cnd %ld | " 238 "# procs %ld, threads %d",
239 nm, x->is_working, x->num_locks, x->cond_lock,
BalancedTree_t ps_syncObjToData
#define ATOMIC_VAR_INIT(value)
lushPtr_SyncObjData_t lushPthr_mem [lushPthr_memSizeElem] GCC_ATTR_VAR_CACHE_ALIGN
#define hpcrun_abort(...)
void lushPthr_init(lushPthr_t *x)
#define atomic_load_explicit(object, order)
#define atomic_store_explicit(object, desired, order)
atomic_long ps_num_idle_cond GCC_ATTR_VAR_CACHE_ALIGN
static lushPtr_SyncObjData_t * lushPthr_getSyncDataPointer(atomic_pthread_spinlock_t lockval)
#define lushPthr_maxValueOfLock
atomic_long ps_num_working GCC_ATTR_VAR_CACHE_ALIGN
void lushPthr_dump(lushPthr_t *x, const char *nm, void *lock)
atomic_long ps_num_procs GCC_ATTR_VAR_CACHE_ALIGN
void lushPthr_processInit()
#define lushPthr_memSizeElem
atomic_long ps_num_working_lock GCC_ATTR_VAR_CACHE_ALIGN
void * hpcrun_malloc(size_t size)
atomic_long ps_num_threads
lushPthr_mem_ptr_t lushPthr_mem_ptr
#define lushPthr_memSizeMax
void BalancedTree_init(BalancedTree_t *tree, BalancedTree_alloc_fn_t allocFn, size_t nodeDataSz)
lushPthr_globals_t globals
static bool lushPthr_isSyncDataPointer(pthread_spinlock_t lockval)