From: adash Date: Thu, 13 Sep 2007 00:16:25 +0000 (+0000) Subject: Starting remote thread : Just test X-Git-Tag: preEdgeChange~450 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70ae682d9d15ff633c2ebcc722a6e464073d2743;p=IRC.git Starting remote thread : Just test --- diff --git a/Robust/src/Analysis/Locality/LocalityAnalysis.java b/Robust/src/Analysis/Locality/LocalityAnalysis.java index 641843e9..c2a9efd7 100644 --- a/Robust/src/Analysis/Locality/LocalityAnalysis.java +++ b/Robust/src/Analysis/Locality/LocalityAnalysis.java @@ -373,9 +373,9 @@ public class LocalityAnalysis { throw new Error("Starting thread on local object not allowed in context:\n"+currlb.getExplanation()); if(thistype.equals(CONFLICT)) throw new Error("Using type that can be either local or global in context:\n"+currlb.getExplanation()); - if(thistype.equals(GLOBAL)&&!isatomic) + if(runmethodset==null&&thistype.equals(GLOBAL)&&!isatomic) throw new Error("Using global object outside of transaction in context:\n"+currlb.getExplanation()); - if (isnative&&thistype.equals(GLOBAL)) + if (runmethodset==null&&isnative&&thistype.equals(GLOBAL)) throw new Error("Potential call to native method "+md+" on global objects:\n"+currlb.getExplanation()); lb.setGlobalThis(thistype); } diff --git a/Robust/src/ClassLibrary/FileOutputStream.java b/Robust/src/ClassLibrary/FileOutputStream.java index 031634ff..d5b1f6bf 100644 --- a/Robust/src/ClassLibrary/FileOutputStream.java +++ b/Robust/src/ClassLibrary/FileOutputStream.java @@ -11,12 +11,15 @@ public class FileOutputStream { if(mode==1) fd=nativeOpen(pathname.getBytes()); } - - + public FileOutputStream(File path) { fd=nativeOpen(path.getPath().getBytes()); } + public FileOutputStreamOpen(String pathname) { + fd = nativeOpen(pathname.getBytes()); + } + private static native int nativeOpen(byte[] filename); private static native int nativeAppend(byte[] filename); private static native void nativeWrite(int fd, byte[] array); diff --git a/Robust/src/ClassLibrary/ThreadDSM.java b/Robust/src/ClassLibrary/ThreadDSM.java index cc659e7a..74980282 100644 --- a/Robust/src/ClassLibrary/ThreadDSM.java +++ b/Robust/src/ClassLibrary/ThreadDSM.java @@ -1,14 +1,8 @@ public class Thread { + public native void start(int mid); - public void start(int mid) { - remotethreadstart(mid); - } - - public native static void sleep(long millis); - - public void run() { - - } - - public native void remotethreadstart(int mid); + public native static void sleep(long millis); + + public void run() { + } } diff --git a/Robust/src/Runtime/DSTM/docs/messages b/Robust/src/Runtime/DSTM/docs/messages index dbe9c94e..993a16e8 100644 --- a/Robust/src/Runtime/DSTM/docs/messages +++ b/Robust/src/Runtime/DSTM/docs/messages @@ -10,12 +10,14 @@ Client messages: OBJECT_FOUND - control, object +>OBJECT_FOUND - control, sizeof object, object >OBJECT_NOT_FOUND - control >OBJECTS_FOUND - control, number of objects, objects >OBJECTS_NOT_FOUND - control, number of objects, oids >TRANS_AGREE - control >TRANS_DISAGREE - control +>TRANS_AGREE_BUT_MISSING_OBJECTS - control, number of objects, objects +>TRANS_SOFT_ABORT - control, control bit identifying is missing objects present of not, number of objects, objects >TRANS_SUCCESSFUL - control possible conversations (conversation means a tcp connection is maintained throughout): diff --git a/Robust/src/Runtime/DSTM/interface/dstm.h b/Robust/src/Runtime/DSTM/interface/dstm.h index 59de2485..69408f02 100644 --- a/Robust/src/Runtime/DSTM/interface/dstm.h +++ b/Robust/src/Runtime/DSTM/interface/dstm.h @@ -208,6 +208,7 @@ int dstmStartup(const char *); void transInit(); int processConfigFile(); void addHost(unsigned int); +void mapObjMethod(unsigned short); void randomdelay(void); transrecord_t *transStart(); @@ -221,7 +222,7 @@ char sendResponse(thread_data_array_t *, int); //Sends control message back to P void *getRemoteObj(transrecord_t *, unsigned int, unsigned int); int transAbortProcess(void *, unsigned int *, int, int); int transComProcess(void*, unsigned int *, unsigned int *, unsigned int *, int, int, int); -void prefetch(int, unsigned int *, short *, short*); +void prefetch(int, unsigned int *, unsigned short *, short*); void *transPrefetch(void *); void *mcqProcess(void *); void checkPrefetchTuples(prefetchqelem_t *); diff --git a/Robust/src/Runtime/DSTM/interface/dstmserver.c b/Robust/src/Runtime/DSTM/interface/dstmserver.c index 5b99b3a6..e8f0718e 100644 --- a/Robust/src/Runtime/DSTM/interface/dstmserver.c +++ b/Robust/src/Runtime/DSTM/interface/dstmserver.c @@ -659,3 +659,4 @@ int prefetchReq(int acceptfd) { } return 0; } + diff --git a/Robust/src/Runtime/DSTM/interface/plookup.c b/Robust/src/Runtime/DSTM/interface/plookup.c index 27abe6ac..b62aa661 100644 --- a/Robust/src/Runtime/DSTM/interface/plookup.c +++ b/Robust/src/Runtime/DSTM/interface/plookup.c @@ -54,7 +54,7 @@ plistnode_t *pInsert(plistnode_t *pile, objheader_t *headeraddr, unsigned int mi tmp->oidcreated[tmp->numcreated] = OID(headeraddr); tmp->numcreated = tmp->numcreated + 1; tmp->sum_bytes += sizeof(objheader_t) + classsize[TYPE(headeraddr)]; - } else if (STATUS(headeraddr) & DIRTY) { + }else if (STATUS(headeraddr) & DIRTY) { tmp->oidmod[tmp->nummod] = OID(headeraddr); tmp->nummod = tmp->nummod + 1; tmp->sum_bytes += sizeof(objheader_t) + classsize[TYPE(headeraddr)]; @@ -93,6 +93,8 @@ plistnode_t *pInsert(plistnode_t *pile, objheader_t *headeraddr, unsigned int mi pile = ptr; } + /* Clear Flags */ + STATUS(headeraddr) &= ~(NEW); STATUS(headeraddr) &= ~(DIRTY); diff --git a/Robust/src/Runtime/DSTM/interface/trans.c b/Robust/src/Runtime/DSTM/interface/trans.c index b08440e8..929ab250 100644 --- a/Robust/src/Runtime/DSTM/interface/trans.c +++ b/Robust/src/Runtime/DSTM/interface/trans.c @@ -62,7 +62,7 @@ inline int findmax(int *array, int arraylength) { } /* This function is a prefetch call generated by the compiler that * populates the shared primary prefetch queue*/ -void prefetch(int ntuples, unsigned int *oids, short *endoffsets, short *arrayfields) { +void prefetch(int ntuples, unsigned int *oids, unsigned short *endoffsets, short *arrayfields) { int qnodesize; int len = 0; @@ -1630,7 +1630,7 @@ int processConfigFile() return -1; } #ifdef MAC - myIpAddr = getMyIpAddr("en1"); + myIpAddr = getMyIpAddr("en0"); #else myIpAddr = getMyIpAddr("eth0"); #endif diff --git a/Robust/src/Runtime/thread.c b/Robust/src/Runtime/thread.c index b070cbb0..19996537 100644 --- a/Robust/src/Runtime/thread.c +++ b/Robust/src/Runtime/thread.c @@ -118,3 +118,9 @@ void CALL01(___Thread______nativeCreate____, struct ___Thread___ * ___this___) { pthread_attr_destroy(&nattr); } #endif + +#ifdef DSTM +void CALL12(___Thread______start____I, int ___mid___, struct ___Thread___ * ___this___, int ___mid___) { + startRemoteThread((unsigned int *)VAR(___this___), ___mid___); +} +#endif