# HG changeset patch # User Me # Date 1275395561 25200 # Node ID f96e4b3b35c7da6573b6cffb6f5739ffb0d1341e # Parent 21842fec64dbbdfc90c9bce3029fca6cc8d1c568 Added win thds diff -r 21842fec64db -r f96e4b3b35c7 VMS.h --- a/VMS.h Tue Jun 01 05:31:40 2010 -0700 +++ b/VMS.h Tue Jun 01 05:32:41 2010 -0700 @@ -11,10 +11,11 @@ #include "VMS_primitive_data_types.h" #include "Queue_impl/BlockingQueue.h" +#include //This value is the number of hardware threads in the shared memory // machine -- make double that number scheduling slots, plus extra for master -#define NUM_WORKERS 4 +#define NUM_CORES 4 #define NUM_SCHED_SLOTS 9 #define SUCCESS 0 @@ -33,8 +34,8 @@ typedef struct { - QueueStruc *workQ; - unsigned int id; + void *endThdPt; + unsigned int coreNum; } ThdParams; @@ -93,15 +94,17 @@ }; - -void * coreLoop( void *paramsIn ); //standard PThreads fn prototype +DWORD WINAPI coreLoop( LPVOID paramsIn ); +//void * coreLoop( void *paramsIn ); //standard PThreads fn prototype +void masterLoop( void *initData, VirtProcr *masterPr ); //===================== Global Vars =================== -pthread_t coreLoopThds[ NUM_WORKERS ]; // std struc, holds thread info -ThdParams thdParams[ NUM_WORKERS ]; +HANDLE coreLoopThds[ NUM_CORES ]; //windows handle to thread +ThdParams *thdParams[ NUM_CORES ]; +DWORD thdIds[ NUM_CORES ]; volatile MasterEnv *_VMSMasterEnv; @@ -110,6 +113,22 @@ // need to save any regs used by core loop (will see if this really works) volatile QueueStruc *_VMSWorkQ; +//========================== +void +VMS__init(); + +void +VMS__start(); + +VirtProcr * +VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); + +inline void +VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ); + +void +VMS__suspend_processor( VirtProcr *callingPr ); + #endif /* _VMS_H */