Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > MeasVMS_impls > MeasVMS__MC_shared_impl
comparison MeasVMS.h @ 0:e123acb162f0
Initial add of MeasVMS semantic layer
Works, but has weird suspend-time histogram -- will try
moving hist updates out of coreloop & out of master and
into the app
| author | Me |
|---|---|
| date | Sat, 11 Sep 2010 03:25:03 -0700 |
| parents | |
| children | bfa2fe3552e4 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4214bb17a276 |
|---|---|
| 1 /* | |
| 2 * Copyright 2009 OpenSourceStewardshipFoundation.org | |
| 3 * Licensed under GNU General Public License version 2 | |
| 4 * | |
| 5 * Author: seanhalle@yahoo.com | |
| 6 * | |
| 7 */ | |
| 8 | |
| 9 #ifndef _MeasVMS_H | |
| 10 #define _MeasVMS_H | |
| 11 | |
| 12 #include "VMS/Queue_impl/PrivateQueue.h" | |
| 13 #include "VMS/Hash_impl/PrivateHash.h" | |
| 14 #include "VMS/Histogram/Histogram.h" | |
| 15 #include "VMS/VMS.h" | |
| 16 | |
| 17 /*This header defines everything specific to the MeasVMS semantic plug-in | |
| 18 */ | |
| 19 typedef struct _MeasVMSSemReq MeasVMSSemReq; | |
| 20 | |
| 21 | |
| 22 /*Semantic layer-specific data sent inside a request from lib called in app | |
| 23 * to request handler called in MasterLoop | |
| 24 */ | |
| 25 enum MeasVMSReqType | |
| 26 { | |
| 27 send_type = 1, | |
| 28 send_from_to, | |
| 29 receive_any, //order and grouping matter -- send before receive | |
| 30 receive_type, // and receive_any first of the receives -- Handlers | |
| 31 receive_from_to,// rely upon this ordering of enum | |
| 32 transfer_to, | |
| 33 transfer_out | |
| 34 }; | |
| 35 | |
| 36 struct _MeasVMSSemReq | |
| 37 { enum MeasVMSReqType reqType; | |
| 38 VirtProcr *sendPr; | |
| 39 VirtProcr *receivePr; | |
| 40 int32 msgType; | |
| 41 void *msg; | |
| 42 MeasVMSSemReq *nextReqInHashEntry; | |
| 43 } | |
| 44 /* MeasVMSSemReq */; | |
| 45 | |
| 46 typedef struct | |
| 47 { | |
| 48 PrivQueueStruc **readyVPQs; | |
| 49 int numVirtPr; | |
| 50 int numTimesCalled; | |
| 51 int firstOfTwo; | |
| 52 int nextCoreToGetNewPr; | |
| 53 | |
| 54 Histogram **addrOfSuspHist; | |
| 55 Histogram **addrOfMasterHist; | |
| 56 } | |
| 57 MeasVMSSemEnv; | |
| 58 | |
| 59 | |
| 60 typedef struct | |
| 61 { | |
| 62 Histogram **suspHistAddr; | |
| 63 Histogram **masterHistAddr; | |
| 64 } | |
| 65 PairOfHistAddresses; | |
| 66 | |
| 67 //=========================================================================== | |
| 68 | |
| 69 void | |
| 70 MeasVMS__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); | |
| 71 | |
| 72 //======================= | |
| 73 | |
| 74 void | |
| 75 MeasVMS__init(); | |
| 76 | |
| 77 void | |
| 78 MeasVMS__cleanup_after_shutdown(); | |
| 79 | |
| 80 //======================= | |
| 81 | |
| 82 inline VirtProcr * | |
| 83 MeasVMS__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, | |
| 84 VirtProcr *creatingPr ); | |
| 85 | |
| 86 void | |
| 87 MeasVMS__dissipate_procr( VirtProcr *procrToDissipate ); | |
| 88 | |
| 89 //======================= | |
| 90 void * | |
| 91 MeasVMS__malloc_size_to( int numBytes, VirtProcr *ownerPr ); | |
| 92 | |
| 93 void | |
| 94 MeasVMS__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, | |
| 95 VirtProcr *newOwnerPr ); | |
| 96 | |
| 97 void | |
| 98 MeasVMS__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ); | |
| 99 | |
| 100 void | |
| 101 MeasVMS__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ); | |
| 102 | |
| 103 void | |
| 104 MeasVMS__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); | |
| 105 | |
| 106 | |
| 107 | |
| 108 //======================= | |
| 109 void | |
| 110 MeasVMS__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, | |
| 111 VirtProcr *receivePr); | |
| 112 | |
| 113 void | |
| 114 MeasVMS__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr); | |
| 115 | |
| 116 void * | |
| 117 MeasVMS__receive_type_to( const int type, VirtProcr *receivePr ); | |
| 118 | |
| 119 void * | |
| 120 MeasVMS__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); | |
| 121 | |
| 122 | |
| 123 //======================= | |
| 124 | |
| 125 void | |
| 126 MeasVMS__free_semantic_request( MeasVMSSemReq *semReq ); | |
| 127 | |
| 128 | |
| 129 //========================= Internal use only ============================= | |
| 130 void | |
| 131 MeasVMS__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); | |
| 132 | |
| 133 VirtProcr * | |
| 134 MeasVMS__schedule_virt_procr( void *_semEnv, int coreNum ); | |
| 135 | |
| 136 | |
| 137 #endif /* _MeasVMS_H */ | |
| 138 |
