Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > MeasVMS_impls > MeasVMS__MC_shared_impl
view 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 |
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _MeasVMS_H
10 #define _MeasVMS_H
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"
17 /*This header defines everything specific to the MeasVMS semantic plug-in
18 */
19 typedef struct _MeasVMSSemReq MeasVMSSemReq;
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 };
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 */;
46 typedef struct
47 {
48 PrivQueueStruc **readyVPQs;
49 int numVirtPr;
50 int numTimesCalled;
51 int firstOfTwo;
52 int nextCoreToGetNewPr;
54 Histogram **addrOfSuspHist;
55 Histogram **addrOfMasterHist;
56 }
57 MeasVMSSemEnv;
60 typedef struct
61 {
62 Histogram **suspHistAddr;
63 Histogram **masterHistAddr;
64 }
65 PairOfHistAddresses;
67 //===========================================================================
69 void
70 MeasVMS__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
72 //=======================
74 void
75 MeasVMS__init();
77 void
78 MeasVMS__cleanup_after_shutdown();
80 //=======================
82 inline VirtProcr *
83 MeasVMS__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
84 VirtProcr *creatingPr );
86 void
87 MeasVMS__dissipate_procr( VirtProcr *procrToDissipate );
89 //=======================
90 void *
91 MeasVMS__malloc_size_to( int numBytes, VirtProcr *ownerPr );
93 void
94 MeasVMS__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
95 VirtProcr *newOwnerPr );
97 void
98 MeasVMS__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
100 void
101 MeasVMS__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
103 void
104 MeasVMS__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
108 //=======================
109 void
110 MeasVMS__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
111 VirtProcr *receivePr);
113 void
114 MeasVMS__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
116 void *
117 MeasVMS__receive_type_to( const int type, VirtProcr *receivePr );
119 void *
120 MeasVMS__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
123 //=======================
125 void
126 MeasVMS__free_semantic_request( MeasVMSSemReq *semReq );
129 //========================= Internal use only =============================
130 void
131 MeasVMS__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
133 VirtProcr *
134 MeasVMS__schedule_virt_procr( void *_semEnv, int coreNum );
137 #endif /* _MeasVMS_H */
