Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff VMS.h @ 7:f96e4b3b35c7
Added win thds
| author | Me |
|---|---|
| date | Tue, 01 Jun 2010 05:32:41 -0700 |
| parents | 6c518bda83fe |
| children | 4b58b9a2527b |
line diff
1.1 --- a/VMS.h Tue Jun 01 05:31:40 2010 -0700 1.2 +++ b/VMS.h Tue Jun 01 05:32:41 2010 -0700 1.3 @@ -11,10 +11,11 @@ 1.4 1.5 #include "VMS_primitive_data_types.h" 1.6 #include "Queue_impl/BlockingQueue.h" 1.7 +#include <windows.h> 1.8 1.9 //This value is the number of hardware threads in the shared memory 1.10 // machine -- make double that number scheduling slots, plus extra for master 1.11 -#define NUM_WORKERS 4 1.12 +#define NUM_CORES 4 1.13 #define NUM_SCHED_SLOTS 9 1.14 1.15 #define SUCCESS 0 1.16 @@ -33,8 +34,8 @@ 1.17 1.18 typedef struct 1.19 { 1.20 - QueueStruc *workQ; 1.21 - unsigned int id; 1.22 + void *endThdPt; 1.23 + unsigned int coreNum; 1.24 } 1.25 ThdParams; 1.26 1.27 @@ -93,15 +94,17 @@ 1.28 }; 1.29 1.30 1.31 - 1.32 -void * coreLoop( void *paramsIn ); //standard PThreads fn prototype 1.33 +DWORD WINAPI coreLoop( LPVOID paramsIn ); 1.34 +//void * coreLoop( void *paramsIn ); //standard PThreads fn prototype 1.35 +void masterLoop( void *initData, VirtProcr *masterPr ); 1.36 1.37 1.38 //===================== Global Vars =================== 1.39 1.40 1.41 -pthread_t coreLoopThds[ NUM_WORKERS ]; // std struc, holds thread info 1.42 -ThdParams thdParams[ NUM_WORKERS ]; 1.43 +HANDLE coreLoopThds[ NUM_CORES ]; //windows handle to thread 1.44 +ThdParams *thdParams[ NUM_CORES ]; 1.45 +DWORD thdIds[ NUM_CORES ]; 1.46 1.47 volatile MasterEnv *_VMSMasterEnv; 1.48 1.49 @@ -110,6 +113,22 @@ 1.50 // need to save any regs used by core loop (will see if this really works) 1.51 volatile QueueStruc *_VMSWorkQ; 1.52 1.53 +//========================== 1.54 +void 1.55 +VMS__init(); 1.56 + 1.57 +void 1.58 +VMS__start(); 1.59 + 1.60 +VirtProcr * 1.61 +VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); 1.62 + 1.63 +inline void 1.64 +VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ); 1.65 + 1.66 +void 1.67 +VMS__suspend_processor( VirtProcr *callingPr ); 1.68 + 1.69 1.70 #endif /* _VMS_H */ 1.71
