for(Iterator<TempDescriptor> tempit=livetemps.iterator();tempit.hasNext();) {
TempDescriptor tmp=tempit.next();
if (writes.contains(tmp)) {
- nodetosavetemps.get(fn).add(tmp);
+ nodetosavetemps.get(atomicnode).add(tmp);
} else if (reads.contains(tmp)&&temptab.get(fn).get(tmp)==GLOBAL) {
- nodetosavetemps.get(fn).add(tmp);
+ nodetosavetemps.get(atomicnode).add(tmp);
}
}
}
outmethod.println("#include \"methodheaders.h\"");
outmethod.println("#include \"virtualtable.h\"");
outmethod.println("#include <runtime.h>");
- if (state.DSM)
+ if (state.DSM)
+{ outmethod.println("#include \"dstm.h\"");
outmethod.println("#include \"localobjects.h\"");
+ }
if (state.THREAD)
outmethod.println("#include <thread.h>");
if (state.main!=null) {
/* Create temp to hold revert table */
if (lb.getHasAtomic()) {
TempDescriptor reverttmp=new TempDescriptor("revertlist", typeutil.getClass(TypeUtil.ObjectClass));
+ if (GENERATEPRECISEGC)
+ objecttemps.addPtr(reverttmp);
+ else
+ objecttemps.addPrim(reverttmp);
reverttable.put(lb, reverttmp);
}
}
public TempDescriptor createNew() {
if (tag==null)
- return new TempDescriptor(name, type);
+ return new TempDescriptor(name+"_"+currentid, type);
else
- return new TempDescriptor(name, type, tag);
+ return new TempDescriptor(name+"_"+currentid, type, tag);
}
public static TempDescriptor tempFactory() {
} objheader_t;
#define OID(x)\
- ((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___nextobject___
+*((unsigned int *)&((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___nextobject___)
#define STATUS(x)\
- ((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___localcopy___
+ *((unsigned int *) &(((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___localcopy___))
#define TYPE(x)\
((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->type
/* Function called at beginning. Passes in the first parameter. */
/* Returns 1 if this thread should run the main process */
-int dstmStartup(char *);
+int dstmStartup(const char *);
void transInit();
void randomdelay(void);
#include "structdefs.h"
#include "garbage.h"
void REVERT_OBJ(struct ___Object___ *);
-#define COMMIT_OBJ(obj) obj->localcopy=NULL
+#define COMMIT_OBJ(obj) obj->___localcopy___=NULL
#ifdef PRECISE_GC
void COPY_OBJ(struct garbagelist * gl, struct ___Object___ *obj);
/* This function starts up the transaction runtime. */
-int dstmStartup(char * option) {
+int dstmStartup(const char * option) {
pthread_t thread_Listen;
pthread_attr_t attr;
int master=strcmp(option, "master")==0;
* Sends a transrequest() to each pile*/
int transCommit(transrecord_t *record) {
unsigned int tot_bytes_mod, *listmid;
- plistnode_t *pile;
+ plistnode_t *pile, *pile_ptr;
int i, rc, val;
int pilecount = 0, offset, threadnum = 0, trecvcount = 0, tmachcount = 0;
char buffer[RECEIVE_BUFFER_SIZE],control;
/* Look through all the objects in the transaction record and make piles
* for each machine involved in the transaction*/
- pile = createPiles(record);
+ pile_ptr = pile = createPiles(record);
/* Create the packet to be sent in TRANS_REQUEST */
while(pile != NULL) {
//Create transaction id
newtid++;
- //trans_req_data_t *tosend;
if ((tosend = calloc(1, sizeof(trans_req_data_t))) == NULL) {
printf("Calloc error %s, %d\n", __FILE__, __LINE__);
return 1;
printf("ERROR return code from pthread_join() is %d\n", rc);
return 1;
}
+ free(thread_data_array[i].buffer);
}
/* Free resources */
pthread_cond_destroy(&tcond);
pthread_mutex_destroy(&tlock);
- free(tosend);
free(listmid);
- pDelete(pile);
+ pDelete(pile_ptr);
free(thread_data_array);
free(ltdata);
if $DSMFLAG
then
-EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -I$DSMRUNTIME"
+EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/mlookup.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.c $DSMRUNTIME/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/prelookup.c $DSMRUNTIME/machinepile.c $DSMRUNTIME/localobjects.c"
fi