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