Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison VMS.h @ 54:f8508572f3de
Added boolean guarded debug messages and VMS__throw_exception
| author | Me |
|---|---|
| date | Tue, 02 Nov 2010 16:43:01 -0700 |
| parents | 42dd44df1bb0 |
| children | 3bac84e4e56e 85b731b290f8 |
comparison
equal
deleted
inserted
replaced
| 21:c35666352d5a | 22:caa939667a34 |
|---|---|
| 20 #include <pthread.h> | 20 #include <pthread.h> |
| 21 #include <sys/time.h> | 21 #include <sys/time.h> |
| 22 | 22 |
| 23 | 23 |
| 24 //=============================== Debug =================================== | 24 //=============================== Debug =================================== |
| 25 //These defines turn types of bug messages on and off | |
| 26 #define dbgProbes FALSE | |
| 27 #define dbgAppFlow FALSE | |
| 28 | |
| 25 //When SEQUENTIAL is defined, VMS does sequential exe in the main thread | 29 //When SEQUENTIAL is defined, VMS does sequential exe in the main thread |
| 26 // It still does co-routines and all the mechanisms are the same, it just | 30 // It still does co-routines and all the mechanisms are the same, it just |
| 27 // has only a single thread and animates VPs one at a time | 31 // has only a single thread and animates VPs one at a time |
| 28 //#define SEQUENTIAL | 32 //#define SEQUENTIAL |
| 29 | 33 |
| 30 //turns on the probe-instrumentation in the application -- when not | 34 //turns on the probe-instrumentation in the application -- when not |
| 31 // defined, the calls to the probe functions turn into comments | 35 // defined, the calls to the probe functions turn into comments |
| 32 #define STATS__ENABLE_PROBES | 36 #define STATS__ENABLE_PROBES |
| 33 | 37 |
| 34 | 38 |
| 35 #define PRINT_DEBUG(msg)// printf(msg); fflush(stdin); | 39 #define DEBUG(msg)// printf(msg); fflush(stdin); |
| 40 #define DEBUG_MSG( bool, msg) //if( bool){ printf(msg); fflush(stdin);} | |
| 36 #define PRINT1_DEBUG(msg, param) //printf(msg, param); fflush(stdin); | 41 #define PRINT1_DEBUG(msg, param) //printf(msg, param); fflush(stdin); |
| 37 #define PRINT2_DEBUG(msg, p1, p2) //printf(msg, p1, p2); fflush(stdin); | 42 #define PRINT2_DEBUG(msg, p1, p2) //printf(msg, p1, p2); fflush(stdin); |
| 38 | 43 |
| 39 #define PRINT_ERROR(msg) printf(msg); fflush(stdin); | 44 #define PRINT_ERROR(msg) printf(msg); fflush(stdin); |
| 40 #define PRINT1_ERROR(msg, param) printf(msg, param); fflush(stdin); | 45 #define PRINT1_ERROR(msg, param) printf(msg, param); fflush(stdin); |
| 41 #define PRINT2_ERROR(msg, p1, p2) printf(msg, p1, p2); fflush(stdin); | 46 #define PRINT2_ERROR(msg, p1, p2) printf(msg, p1, p2); fflush(stdin); |
| 42 | |
| 43 | 47 |
| 44 //=========================== STATS ======================= | 48 //=========================== STATS ======================= |
| 45 | 49 |
| 46 //when MEAS__TIME_STAMP_SUSP is defined, causes code to be inserted and | 50 //when MEAS__TIME_STAMP_SUSP is defined, causes code to be inserted and |
| 47 // compiled-in that saves the low part of the time stamp count just before | 51 // compiled-in that saves the low part of the time stamp count just before |
| 65 | 69 |
| 66 #define MIN_WORK_UNIT_CYCLES 20000 | 70 #define MIN_WORK_UNIT_CYCLES 20000 |
| 67 | 71 |
| 68 #define MASTERLOCK_RETRIES 10000 | 72 #define MASTERLOCK_RETRIES 10000 |
| 69 | 73 |
| 70 // stack | 74 // stack size in virtual processors created |
| 71 #define VIRT_PROCR_STACK_SIZE 0x4000 | 75 #define VIRT_PROCR_STACK_SIZE 0x4000 /* 16K */ |
| 72 | 76 |
| 73 // memory for VMS__malloc -- 256M | 77 // memory for VMS__malloc |
| 74 #define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x10000000 | 78 #define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x10000000 /* 256M */ |
| 75 | 79 |
| 76 | 80 |
| 77 //============================== | 81 //============================== |
| 78 | 82 |
| 79 #define SUCCESS 0 | 83 #define SUCCESS 0 |
| 210 int32 masterCreateProbeID; | 214 int32 masterCreateProbeID; |
| 211 float64 createPtInSecs; | 215 float64 createPtInSecs; |
| 212 } | 216 } |
| 213 MasterEnv; | 217 MasterEnv; |
| 214 | 218 |
| 215 | 219 //============================= |
| 220 typedef struct | |
| 221 { | |
| 222 | |
| 223 } | |
| 224 VMSExcp; | |
| 216 | 225 |
| 217 | 226 |
| 218 //======================= OS Thread related =============================== | 227 //======================= OS Thread related =============================== |
| 219 | 228 |
| 220 void * coreLoop( void *paramsIn ); //standard PThreads fn prototype | 229 void * coreLoop( void *paramsIn ); //standard PThreads fn prototype |
| 270 VirtProcr * | 279 VirtProcr * |
| 271 VMS_ext__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); | 280 VMS_ext__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); |
| 272 | 281 |
| 273 void | 282 void |
| 274 VMS_ext__dissipate_procr( VirtProcr *procrToDissipate ); | 283 VMS_ext__dissipate_procr( VirtProcr *procrToDissipate ); |
| 284 | |
| 285 void | |
| 286 VMS__throw_exception( char *msgStr, VirtProcr *reqstPr, VMSExcp *excpData ); | |
| 275 | 287 |
| 276 void | 288 void |
| 277 VMS__shutdown(); | 289 VMS__shutdown(); |
| 278 | 290 |
| 279 void | 291 void |
