#include "rcr_runtime.h"
#include "mlp_runtime.h"
-__thread struct trQueue * TRqueue;
-
-void workerTR(void *x) {
+void * workerTR(void *x) {
struct trQueue * queue=(struct trQueue *)x;
while(1) {
SESEcommon * tmp;
}
+ return NULL;
}
#include "coreprof/coreprof.h"
#ifdef RCR
#include "rcr_runtime.h"
+#include "trqueue.h"
#endif
// NOTE: Converting this from a work-stealing strategy
#ifdef RCR
#include "trqueue.h"
-__thread struct trqueue * TRqueue;
+__thread struct trQueue * TRqueue=NULL;
#endif
pthread_attr_t nattr;
pthread_attr_init(&nattr);
pthread_attr_setdetachstate(&nattr, PTHREAD_CREATE_DETACHED);
- TRqueue=allocTR();
- int status = pthread_create( &(workerDataArray[i].workerThread),
+ if (TRqueue==NULL)
+ TRqueue=allocTR();
+ int status = pthread_create( &thread,
NULL,
workerTR,
(void*) TRqueue);
// this code) will become a worker thread after setup
workerDataArray = RUNMALLOC( sizeof( WorkerData ) * (numWorkers+1) );
+#ifdef RCR
+ //make sure the queue is initialized
+ if (TRqueue==NULL)
+ TRqueue=allocTR();
+#endif
+
for( i = 0; i < numWorkers; ++i ) {
// the original thread is ID 1, start counting from there
then
JAVAOPTS="$JAVAOPTS -rcr"
RCR=true
-EXTRAOPTIONS="$EXTRAOPTIONS -I$ROBUSTROOT/Runtime/oooJava"
+EXTRAOPTIONS="$EXTRAOPTIONS -DRCR -I$ROBUSTROOT/Runtime/oooJava"
elif [[ $1 = '-coreprof' ]]