Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VCilk_impls > VCilk__MC_shared_impl
diff VCilk.h @ 2:2845dca6a28b
Updated VCilk to same VMS version as SSR, for correct blocked MM Nov 8
| author | Me |
|---|---|
| date | Mon, 08 Nov 2010 03:58:41 -0800 |
| parents | b456b67cddd0 |
| children | 5494943ed3a4 |
line diff
1.1 --- a/VCilk.h Sun Nov 07 06:53:21 2010 -0800 1.2 +++ b/VCilk.h Mon Nov 08 03:58:41 2010 -0800 1.3 @@ -13,9 +13,19 @@ 1.4 #include "VMS/Hash_impl/PrivateHash.h" 1.5 #include "VMS/VMS.h" 1.6 1.7 + 1.8 + 1.9 /*This header defines everything specific to the VCilk semantic plug-in 1.10 */ 1.11 + 1.12 +//=========================================================================== 1.13 +#define NUM_STRUCS_IN_SEM_ENV 1000 1.14 + 1.15 +//=========================================================================== 1.16 typedef struct _VCilkSemReq VCilkSemReq; 1.17 +typedef void (*PtrToAtomicFn ) ( void * ); //executed atomically in master 1.18 + 1.19 +//=========================================================================== 1.20 1.21 1.22 /*Semantic layer-specific data sent inside a request from lib called in app 1.23 @@ -25,35 +35,71 @@ 1.24 { 1.25 syncReq = 1, 1.26 mallocReq, 1.27 - freeReq 1.28 + freeReq, 1.29 + singleton, 1.30 + atomic, 1.31 + trans_start, 1.32 + trans_end 1.33 }; 1.34 1.35 struct _VCilkSemReq 1.36 { enum VCilkReqType reqType; 1.37 VirtProcr *requestingPr; 1.38 + 1.39 int32 sizeToMalloc; 1.40 void *ptrToFree; 1.41 + 1.42 VirtProcrFnPtr fnPtr; 1.43 void *initData; 1.44 int32 coreToSpawnOnto; 1.45 + 1.46 + int32 singletonID; 1.47 + void *endJumpPt; 1.48 + 1.49 + PtrToAtomicFn fnToExecInMaster; 1.50 + void *dataForFn; 1.51 + 1.52 + int32 transID; 1.53 } 1.54 /* VCilkSemReq */; 1.55 1.56 typedef struct 1.57 { 1.58 + VirtProcr *VPCurrentlyExecuting; 1.59 + PrivQueueStruc *waitingVPQ; 1.60 + } 1.61 +VCilkTrans; 1.62 + 1.63 +typedef struct 1.64 + { 1.65 PrivQueueStruc **readyVPQs; 1.66 HashTable *commHashTbl; 1.67 int32 numVirtPr; 1.68 int32 nextCoreToGetNewPr; 1.69 int32 primitiveStartTime; 1.70 + 1.71 + //fix limit on num with dynArray 1.72 + int32 singletonHasBeenExecutedFlags[NUM_STRUCS_IN_SEM_ENV]; 1.73 + VCilkTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; 1.74 } 1.75 VCilkSemEnv; 1.76 1.77 +typedef struct _TransListElem TransListElem; 1.78 +struct _TransListElem 1.79 + { 1.80 + int32 transID; 1.81 + TransListElem *nextTrans; 1.82 + }; 1.83 +//TransListElem 1.84 + 1.85 typedef struct 1.86 { 1.87 - int32 syncPending; 1.88 - int32 numLiveChildren; 1.89 - VirtProcr *parentPr; 1.90 + int32 syncPending; 1.91 + int32 numLiveChildren; 1.92 + VirtProcr *parentPr; 1.93 + 1.94 + int32 highestTransEntered; 1.95 + TransListElem *lastTransEntered; 1.96 } 1.97 VCilkSemData; 1.98 1.99 @@ -80,7 +126,7 @@ 1.100 VCilk__init(); 1.101 1.102 void 1.103 -VCilk__cleanup_after_shutdown(); 1.104 +VCilk__cleanup_at_end_of_shutdown(); 1.105 1.106 //======================= 1.107 1.108 @@ -103,10 +149,21 @@ 1.109 void 1.110 VCilk__dissipate_procr( VirtProcr *procrToDissipate ); 1.111 1.112 -//======================= 1.113 + 1.114 +//======================= Concurrency Stuff ====================== 1.115 +void 1.116 +VCilk__start_singleton( int32 singletonID, void *endSingletonLabelAddr, 1.117 + VirtProcr *animPr ); 1.118 1.119 void 1.120 -VCilk__free_semantic_request( VCilkSemReq *semReq ); 1.121 +VCilk__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, 1.122 + void *data, VirtProcr *animPr ); 1.123 + 1.124 +void 1.125 +VCilk__start_transaction( int32 transactionID, VirtProcr *animPr ); 1.126 + 1.127 +void 1.128 +VCilk__end_transaction( int32 transactionID, VirtProcr *animPr ); 1.129 1.130 1.131 //========================= Internal use only =============================
