From: bdemsky Date: Thu, 15 Mar 2007 08:07:06 +0000 (+0000) Subject: Changes to benchmarks X-Git-Tag: preEdgeChange~657 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5031700a0135d6e408123ce1393199faf9d78b19;p=IRC.git Changes to benchmarks Small changes to runtime Build binaries that exit upon SIGUSR2 so we can get output... --- diff --git a/Robust/src/Benchmarks/Chat/ChatServer.java b/Robust/src/Benchmarks/Chat/ChatServer.java index aed388ea..50d256b9 100644 --- a/Robust/src/Benchmarks/Chat/ChatServer.java +++ b/Robust/src/Benchmarks/Chat/ChatServer.java @@ -26,5 +26,10 @@ task Message(ChatSocket cs{InRoom && IOPending}) { byte buffer[]=new byte[1024]; int length=cs.read(buffer); String st=(new String(buffer)).subString(0, length); - cs.room.sendToRoom(cs, st.getBytes()); + Message m=new Message(st, cs){}; +} + +task SendMessage(Message m{!Sent}) { + m.cs.room.sendToRoom(m.cs,m.st.getBytes()); + taskexit(m {Sent}); } diff --git a/Robust/src/Benchmarks/ChatJava/ChatThread.java b/Robust/src/Benchmarks/ChatJava/ChatThread.java index db533329..7500abe9 100644 --- a/Robust/src/Benchmarks/ChatJava/ChatThread.java +++ b/Robust/src/Benchmarks/ChatJava/ChatThread.java @@ -30,10 +30,6 @@ public class ChatThread extends Thread { byte buffer[]=new byte[1024]; int length=sock.read(buffer); String st=(new String(buffer)).subString(0, length); - System.printString(st); - System.printString("\n"); - System.printInt(length); - System.printString("\n"); room.sendToRoom(this, st.getBytes()); } diff --git a/Robust/src/Benchmarks/WebServerJava/Inventory.java b/Robust/src/Benchmarks/WebServerJava/Inventory.java index 7b6ee7c5..4c839535 100644 --- a/Robust/src/Benchmarks/WebServerJava/Inventory.java +++ b/Robust/src/Benchmarks/WebServerJava/Inventory.java @@ -1,7 +1,4 @@ public class Inventory { - // Inventory flags - flag TransInitialize; - // Transaction variables int numitems; HashMap map; diff --git a/Robust/src/Benchmarks/WebServerJava/Logger.java b/Robust/src/Benchmarks/WebServerJava/Logger.java index be29b3d3..9e7d3aba 100644 --- a/Robust/src/Benchmarks/WebServerJava/Logger.java +++ b/Robust/src/Benchmarks/WebServerJava/Logger.java @@ -1,6 +1,4 @@ public class Logger { - //Logger flag - flag Initialize; FileOutputStream fos; diff --git a/Robust/src/ClassLibrary/String.java b/Robust/src/ClassLibrary/String.java index 13798ff0..689d3cf9 100644 --- a/Robust/src/ClassLibrary/String.java +++ b/Robust/src/ClassLibrary/String.java @@ -65,6 +65,17 @@ public class String { return -1; } + public String replace(char oldch, char newch) { + char[] buffer=new char[count]; + for(int i=0;isrc); + unsigned int hashcode=genhashfunction(ht, tmpptr->src); struct genpointerlist *nextptr=tmpptr->next; tmpptr->next=newbins[hashcode]; newbins[hashcode]=tmpptr; @@ -60,7 +60,6 @@ int hashsize(struct genhashtable *ht) { } void genrehash(struct genhashtable * ht) { - /* Expand hashtable */ struct genpointerlist **newbins=(struct genpointerlist **) RUNMALLOC(sizeof (struct genpointerlist *)*ht->currentsize); struct genpointerlist **oldbins=ht->bins; long j,i; @@ -68,7 +67,7 @@ void genrehash(struct genhashtable * ht) { for(i=0;icurrentsize;i++) { struct genpointerlist * tmpptr=oldbins[i]; while(tmpptr!=NULL) { - int hashcode=genhashfunction(ht, tmpptr->src); + unsigned int hashcode=genhashfunction(ht, tmpptr->src); struct genpointerlist *nextptr=tmpptr->next; tmpptr->next=newbins[hashcode]; newbins[hashcode]=tmpptr; diff --git a/Robust/src/Runtime/checkpoint.c b/Robust/src/Runtime/checkpoint.c index d7556a72..f77a551d 100644 --- a/Robust/src/Runtime/checkpoint.c +++ b/Robust/src/Runtime/checkpoint.c @@ -228,7 +228,7 @@ void restorecheckpoint(int numparams, void ** original, void ** checkpoint, stru } if (hasflags[type]) { (((void **)cpy)[2])=flagptr; - flagorand(cpy, 1, 0xFFFFFFFF); + flagorandinit(cpy, 0, 0xFFFFFFFF); } } } diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index 7a7de465..b905affb 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -56,7 +56,7 @@ int main(int argc, char **argv) { initializemmap(); #endif processOptions(); - + initializeexithandler(); /* Create table for failed tasks */ failedtasks=genallocatehashtable((unsigned int (*)(void *)) &hashCodetpd, (int (*)(void *,void *)) &comparetpd); @@ -309,6 +309,7 @@ void executetasks() { if (FD_ISSET(fd, &tmpreadfds)) { /* Set ready flag on object */ void * objptr; + // printf("Setting fd %d\n",fd); if (RuntimeHashget(fdtoobject, fd,(int *) &objptr)) { flagorand(objptr,1,0xFFFFFFFF); /* Set the first flag to 1 */ } @@ -425,6 +426,19 @@ void processtasks() { #endif +void exithandler(int sig, siginfo_t *info, void * uap) { + exit(0); +} + +void initializeexithandler() { + struct sigaction sig; + sig.sa_sigaction=&exithandler; + sig.sa_flags=SA_SIGINFO; + sigemptyset(&sig.sa_mask); + sigaction(SIGUSR2, &sig, 0); +} + + /* This function inject failures */ void injectinstructionfailure() { diff --git a/Robust/src/Runtime/runtime.h b/Robust/src/Runtime/runtime.h index 3141f83c..60b656aa 100644 --- a/Robust/src/Runtime/runtime.h +++ b/Robust/src/Runtime/runtime.h @@ -16,6 +16,7 @@ struct ArrayObject * allocate_newarray(int type, int length); struct ___String___ * NewString(const char *str,int length); #endif +void initializeexithandler(); void failedboundschk(); void failednullptr(); void abort_task(); diff --git a/Robust/src/Runtime/socket.c b/Robust/src/Runtime/socket.c index 542f2dee..d1ddf28a 100644 --- a/Robust/src/Runtime/socket.c +++ b/Robust/src/Runtime/socket.c @@ -292,6 +292,7 @@ void CALL02(___Socket______nativeWrite_____AR_B, struct ___Socket___ * ___this__ if (bytewritten!=length) { perror("ERROR IN NATIVEWRITE"); + printf("Supposed to write %d, wrote %d\n", length, bytewritten); } break; } @@ -308,13 +309,20 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, struct listitem *tmp=stopforgc((struct garbagelist *)___params___); #endif #endif - int byteread=read(fd, charstr, length); + int byteread; + + // printf("Doing read on %d\n",fd); + while(1) { + byteread=read(fd, charstr, length); + + break; + } #ifdef THREADS #ifdef PRECISE_GC restartaftergc(tmp); #endif #endif - + { int i; for(i=0;i