|
|
|
@ -55,7 +55,7 @@ thread_recursive(void *arg)
|
|
|
|
|
{
|
|
|
|
|
int i = ITERATE;
|
|
|
|
|
unsigned int l;
|
|
|
|
|
unsigned int tid = *(int *) arg;
|
|
|
|
|
int tid = ck_pr_load_int(arg);
|
|
|
|
|
|
|
|
|
|
if (aff_iterate(&a)) {
|
|
|
|
|
perror("ERROR: Could not affine thread");
|
|
|
|
@ -127,10 +127,12 @@ thread_recursive(void *arg)
|
|
|
|
|
|
|
|
|
|
#ifdef CK_F_PR_RTM
|
|
|
|
|
static void *
|
|
|
|
|
thread_rtm_adaptive(void *null CK_CC_UNUSED)
|
|
|
|
|
thread_rtm_adaptive(void *arg)
|
|
|
|
|
{
|
|
|
|
|
unsigned int i = ITERATE;
|
|
|
|
|
unsigned int l;
|
|
|
|
|
int tid = ck_pr_load_int(arg);
|
|
|
|
|
|
|
|
|
|
struct ck_elide_config config = CK_ELIDE_CONFIG_DEFAULT_INITIALIZER;
|
|
|
|
|
struct ck_elide_stat st = CK_ELIDE_STAT_INITIALIZER;
|
|
|
|
|
|
|
|
|
@ -140,6 +142,7 @@ thread_rtm_adaptive(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (i--) {
|
|
|
|
|
if (tid == 0) {
|
|
|
|
|
CK_ELIDE_LOCK_ADAPTIVE(ck_swlock_write, &st, &config, &lock);
|
|
|
|
|
{
|
|
|
|
|
l = ck_pr_load_uint(&locked);
|
|
|
|
@ -176,6 +179,7 @@ thread_rtm_adaptive(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CK_ELIDE_UNLOCK_ADAPTIVE(ck_swlock_write, &st, &lock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CK_ELIDE_LOCK(ck_swlock_read, &lock);
|
|
|
|
|
{
|
|
|
|
@ -191,10 +195,11 @@ thread_rtm_adaptive(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void *
|
|
|
|
|
thread_rtm_mix(void *null CK_CC_UNUSED)
|
|
|
|
|
thread_rtm_mix(void *arg)
|
|
|
|
|
{
|
|
|
|
|
unsigned int i = ITERATE;
|
|
|
|
|
unsigned int l;
|
|
|
|
|
int tid = ck_pr_load_int(arg);
|
|
|
|
|
|
|
|
|
|
if (aff_iterate(&a)) {
|
|
|
|
|
perror("ERROR: Could not affine thread");
|
|
|
|
@ -202,6 +207,7 @@ thread_rtm_mix(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (i--) {
|
|
|
|
|
if (tid == 0) {
|
|
|
|
|
if (i & 1) {
|
|
|
|
|
CK_ELIDE_LOCK(ck_swlock_write, &lock);
|
|
|
|
|
} else {
|
|
|
|
@ -248,7 +254,7 @@ thread_rtm_mix(void *null CK_CC_UNUSED)
|
|
|
|
|
} else {
|
|
|
|
|
ck_swlock_write_unlock(&lock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (i & 1) {
|
|
|
|
|
CK_ELIDE_LOCK(ck_swlock_read, &lock);
|
|
|
|
|
} else {
|
|
|
|
@ -273,10 +279,11 @@ thread_rtm_mix(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void *
|
|
|
|
|
thread_rtm(void *null CK_CC_UNUSED)
|
|
|
|
|
thread_rtm(void *arg)
|
|
|
|
|
{
|
|
|
|
|
unsigned int i = ITERATE;
|
|
|
|
|
unsigned int l;
|
|
|
|
|
int tid = ck_pr_load_int(arg);
|
|
|
|
|
|
|
|
|
|
if (aff_iterate(&a)) {
|
|
|
|
|
perror("ERROR: Could not affine thread");
|
|
|
|
@ -284,6 +291,7 @@ thread_rtm(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (i--) {
|
|
|
|
|
if (tid == 0) {
|
|
|
|
|
CK_ELIDE_LOCK(ck_swlock_write, &lock);
|
|
|
|
|
{
|
|
|
|
|
l = ck_pr_load_uint(&locked);
|
|
|
|
@ -320,6 +328,7 @@ thread_rtm(void *null CK_CC_UNUSED)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CK_ELIDE_UNLOCK(ck_swlock_write, &lock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CK_ELIDE_LOCK(ck_swlock_read, &lock);
|
|
|
|
|
{
|
|
|
|
|