printf("%s() error in sending udp message at %s, %d\n", __func__, __FILE__, __LINE__);
return -1;
}
- /* Send trans commit or abort message when prefetching or caching */
- for(i=0;i<pilecount;i++){
- if(socklist[i] !=0)
- send_data(socklist[i], &finalresponse, sizeof(char));
- }
return 0;
}
return 1;
}
+#ifdef CACHE
+ if (finalResponse == TRANS_COMMIT) {
+ /* Invalidate objects in other machine cache */
+ int retval;
+ if((retval = invalidateObj(tosend, pilecount,finalResponse,socklist)) != 0) {
+ printf("Error: %s() in invalidating Objects %s, %d\n", __func__, __FILE__, __LINE__);
+ free(tosend);
+ free(listmid);
+ return 1;
+ }
+ }
+#endif
/* Send responses to all machines */
for(i = 0; i < pilecount; i++) {
int sd = socklist[i];
}
#endif
#endif
-#ifndef CACHE
- send_data(sd, &finalResponse, sizeof(char));
-#endif
+ send_data(sd, &finalResponse, sizeof(char));
} else {
/* Complete local processing */
doLocalProcess(finalResponse, &(tosend[i]), &transinfo);
}
}
-#ifdef CACHE
- {
- /* Invalidate objects in other machine cache */
- int retval;
- if((retval = invalidateObj(tosend, pilecount,finalResponse,socklist)) != 0) {
- printf("Error: %s() in invalidating Objects %s, %d\n", __func__, __FILE__, __LINE__);
- free(tosend);
- free(listmid);
- return 1;
- }
- }
-#endif
/* Free resources */
free(tosend);
free(listmid);