# HG changeset patch # User Me # Date 1277000809 25200 # Node ID 4b58b9a2527b943026be7b3a7f8201762024095e # Parent d801fe740275a9bd7a2774751f112d126e049589 Middle of testing core loop diff -r d801fe740275 -r 4b58b9a2527b VMS.h --- a/VMS.h Sat Jun 19 19:26:38 2010 -0700 +++ b/VMS.h Sat Jun 19 19:26:49 2010 -0700 @@ -12,6 +12,7 @@ #include "VMS_primitive_data_types.h" #include "Queue_impl/BlockingQueue.h" #include +#include //This value is the number of hardware threads in the shared memory // machine -- make double that number scheduling slots, plus extra for master @@ -20,7 +21,7 @@ #define SUCCESS 0 -#define thdAttrs NULL +//#define thdAttrs NULL //For PThreads typedef struct _WorkUnit WorkUnit; typedef struct _VirtProcr VirtProcr; @@ -48,7 +49,7 @@ struct _VirtProcr - { + { int procrID; //for debugging -- count up each time create void *stackPtr; void *framePtr; void *nextInstrPt; @@ -102,16 +103,17 @@ //===================== Global Vars =================== -HANDLE coreLoopThds[ NUM_CORES ]; //windows handle to thread -ThdParams *thdParams[ NUM_CORES ]; -DWORD thdIds[ NUM_CORES ]; +HANDLE coreLoopThdHandles[ NUM_CORES ]; //windows handle to thread +ThdParams *coreLoopThdParams[ NUM_CORES ]; +DWORD coreLoopThdIds[ NUM_CORES ]; -volatile MasterEnv *_VMSMasterEnv; + //TODO: Debug: figure out if need to be volatile or not +volatile MasterEnv *_VMSMasterEnv; //workQ is global, static, and volatile so that core loop has its location // hard coded, and reloads every time through the loop -- that way don't // need to save any regs used by core loop (will see if this really works) -volatile QueueStruc *_VMSWorkQ; +volatile CASQueueStruc *_VMSWorkQ; //========================== void @@ -129,6 +131,22 @@ void VMS__suspend_processor( VirtProcr *callingPr ); +//============================= Statistics ================================== + +typedef unsigned long long TSCount; + +#define saveTimeStampCountInto(low, high) \ + asm volatile("RDTSC; \ + movl %%eax, %0; \ + movl %%edx, %1;" \ + /* outputs */ : "=m" (low), "=m" (high)\ + /* inputs */ : \ + /* clobber */ : "%eax", "%edx" \ + ); + +inline TSCount getTSCount(); + +int numProcrsCreated; #endif /* _VMS_H */