Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
comparison SSR.h @ 21:ad29ff7a0209
Buggy version of singltons -- data plus Fn singletons now -- about to fix
| author | Me |
|---|---|
| date | Sat, 13 Nov 2010 14:38:33 -0800 |
| parents | 562e68094af7 |
| children | fef69b887df4 |
comparison
equal
deleted
inserted
replaced
| 7:c351e0f909f2 | 8:6361e916c751 |
|---|---|
| 25 //=========================================================================== | 25 //=========================================================================== |
| 26 | 26 |
| 27 /*Semantic layer-specific data sent inside a request from lib called in app | 27 /*Semantic layer-specific data sent inside a request from lib called in app |
| 28 * to request handler called in MasterLoop | 28 * to request handler called in MasterLoop |
| 29 */ | 29 */ |
| 30 | |
| 31 typedef struct | |
| 32 { | |
| 33 VirtProcr *VPCurrentlyExecuting; | |
| 34 PrivQueueStruc *waitingVPQ; | |
| 35 } | |
| 36 SSRTrans; | |
| 37 | |
| 38 typedef struct | |
| 39 { | |
| 40 int32 hasBeenStarted; | |
| 41 int32 hasFinished; | |
| 42 void *endInstrAddr; | |
| 43 PrivQueueStruc *waitQ; | |
| 44 } | |
| 45 SSRSingleton; | |
| 46 | |
| 30 enum SSRReqType | 47 enum SSRReqType |
| 31 { | 48 { |
| 32 send_type = 1, | 49 send_type = 1, |
| 33 send_from_to, | 50 send_from_to, |
| 34 receive_any, //order and grouping matter -- send before receive | 51 receive_any, //order and grouping matter -- send before receive |
| 36 receive_from_to,// rely upon this ordering of enum | 53 receive_from_to,// rely upon this ordering of enum |
| 37 transfer_to, | 54 transfer_to, |
| 38 transfer_out, | 55 transfer_out, |
| 39 malloc_req, | 56 malloc_req, |
| 40 free_req, | 57 free_req, |
| 41 singleton, | 58 singleton_fn_start, |
| 59 singleton_fn_end, | |
| 60 singleton_data_start, | |
| 61 singleton_data_end, | |
| 42 atomic, | 62 atomic, |
| 43 trans_start, | 63 trans_start, |
| 44 trans_end | 64 trans_end |
| 45 }; | 65 }; |
| 46 | 66 |
| 58 | 78 |
| 59 int32 sizeToMalloc; | 79 int32 sizeToMalloc; |
| 60 void *ptrToFree; | 80 void *ptrToFree; |
| 61 | 81 |
| 62 int32 singletonID; | 82 int32 singletonID; |
| 63 void *endJumpPt; | 83 SSRSingleton **singletonAddr; |
| 64 | 84 |
| 65 PtrToAtomicFn fnToExecInMaster; | 85 PtrToAtomicFn fnToExecInMaster; |
| 66 void *dataForFn; | 86 void *dataForFn; |
| 67 | 87 |
| 68 int32 transID; | 88 int32 transID; |
| 69 } | 89 } |
| 70 /* SSRSemReq */; | 90 /* SSRSemReq */; |
| 71 | 91 |
| 72 | |
| 73 typedef struct | |
| 74 { | |
| 75 VirtProcr *VPCurrentlyExecuting; | |
| 76 PrivQueueStruc *waitingVPQ; | |
| 77 } | |
| 78 SSRTrans; | |
| 79 | 92 |
| 80 typedef struct | 93 typedef struct |
| 81 { | 94 { |
| 82 PrivQueueStruc **readyVPQs; | 95 PrivQueueStruc **readyVPQs; |
| 83 HashTable *commHashTbl; | 96 HashTable *commHashTbl; |
| 84 int32 numVirtPr; | 97 int32 numVirtPr; |
| 85 int32 nextCoreToGetNewPr; | 98 int32 nextCoreToGetNewPr; |
| 86 int32 primitiveStartTime; | 99 int32 primitiveStartTime; |
| 87 | 100 |
| 88 //fix limit on num with dynArray | 101 //fix limit on num with dynArray |
| 89 int32 singletonHasBeenExecutedFlags[NUM_STRUCS_IN_SEM_ENV]; | 102 SSRSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; |
| 90 SSRTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; | 103 SSRTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; |
| 91 } | 104 } |
| 92 SSRSemEnv; | 105 SSRSemEnv; |
| 93 | 106 |
| 94 | 107 |
| 185 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); | 198 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); |
| 186 | 199 |
| 187 | 200 |
| 188 //======================= Concurrency Stuff ====================== | 201 //======================= Concurrency Stuff ====================== |
| 189 void | 202 void |
| 190 SSR__start_singleton( int32 singletonID, void *endSingletonLabelAddr, | 203 SSR__start_fn_singleton( int32 singletonID, VirtProcr *animPr ); |
| 191 VirtProcr *animPr ); | 204 |
| 205 void | |
| 206 SSR__end_fn_singleton( int32 singletonID, VirtProcr *animPr ); | |
| 207 | |
| 208 void | |
| 209 SSR__start_data_singleton( SSRSingleton **singeltonAddr, VirtProcr *animPr ); | |
| 210 | |
| 211 void | |
| 212 SSR__end_data_singleton( SSRSingleton **singletonAddr, VirtProcr *animPr ); | |
| 192 | 213 |
| 193 void | 214 void |
| 194 SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, | 215 SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, |
| 195 void *data, VirtProcr *animPr ); | 216 void *data, VirtProcr *animPr ); |
| 196 | 217 |
