Common.java \
GlobalArgs.java \
../../../ClassLibrary/JavaSTM/Barrier.java
-FLAGS=-mainclass ${MAINCLASS} -singleTM -optimize -debug -dcopts -joptimize -fastmemcpy -garbagestats
-FLAGS2=-mainclass ${MAINCLASS} -optimize -debug -joptimize -thread
+FLAGS=-mainclass ${MAINCLASS} -singleTM -optimize -debug -dcopts -joptimize -transstats -stmstats
+FLAGS2=-mainclass ${MAINCLASS} -singleTM -optimize -debug -dcopts -joptimize -transstats
+FLAGS3=-mainclass ${MAINCLASS} -optimize -debug -joptimize -thread
default:
../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC}
- ../../../buildscript ${FLAGS2} -o NON${MAINCLASS} ${SRC}
+ ../../../buildscript ${FLAGS3} -o LOCK${MAINCLASS} ${SRC}
+ ../../../buildscript ${FLAGS2} -o GEN${MAINCLASS} ${SRC}
clean:
rm -rf tmpbuilddirectory
nSoftAbort++;
#endif
softaborted++;
- if (softaborted>4) {
+ if (1) {
+ //if (softaborted>1) {
//retry if too many soft aborts
freenewobjs();
#ifdef STMSTATS
t_chashreset();
return TRANS_ABORT;
}
- randomdelay(softaborted);
+ //randomdelay(softaborted);
} else {
printf("Error: in %s() Unknown outcome", __func__);
exit(-1);
--- /dev/null
+#include "stmlock.h"
+#include <stdio.h>
+
+inline void initdsmlocks(volatile unsigned int *addr) {
+ (*addr) = RW_LOCK_BIAS;
+}
+
+int write_trylock(volatile unsigned int *lock) {
+ int retval=0;
+ __asm__ __volatile__("xchgl %0,%1"
+ : "=r"(retval)
+ : "m"(*__xg(lock)), "0"(retval)
+ : "memory");
+ return retval;
+}
+
+void write_unlock(volatile unsigned int *lock) {
+ __asm __volatile__("movl $1, %0" : "+m" (*__xg(lock))::"memory");
+}
+
--- /dev/null
+#ifndef _STMLOCK_H_
+#define _STMLOCK_H_
+
+#define RW_LOCK_BIAS 1
+#define LOCK_UNLOCKED { LOCK_BIAS }
+
+struct __xchg_dummy {
+ unsigned long a[100];
+};
+
+#define __xg(x) ((struct __xchg_dummy *)(x))
+
+void initdsmlocks(volatile unsigned int *addr);
+int write_trylock(volatile unsigned int *lock);
+void write_unlock(volatile unsigned int *lock);
+
+#endif
#include <sys/time.h>
#include <errno.h>
#include "stmlookup.h"
-#include "dsmlock.h"
+#include "stmlock.h"
/* ==================================
* Bit designation for status field
if $SINGLETM
then
EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
-FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c"
+FILES="$FILES $DSMRUNTIME/stmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c"
fi
if $ABORTREADERS