Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > MeasVMS_impls > MeasVMS__MC_shared_impl
view MeasVMS.h @ 2:a99b99c2b814
minor chgs in measurement stuff
| author | Me |
|---|---|
| date | Sat, 16 Oct 2010 04:12:28 -0700 |
| parents | bfa2fe3552e4 |
| children | 405a1b793325 |
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 *suspHist;
63 Histogram *masterHist;
64 }
65 HistCarrier;
68 //===========================================================================
70 //===========================================================================
72 void
73 MeasVMS__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
75 //=======================
77 void
78 MeasVMS__init();
80 void
81 MeasVMS__cleanup_after_shutdown();
83 //=======================
85 inline VirtProcr *
86 MeasVMS__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
87 VirtProcr *creatingPr );
89 void
90 MeasVMS__dissipate_procr( VirtProcr *procrToDissipate );
92 //=======================
93 void *
94 MeasVMS__malloc_size_to( int numBytes, VirtProcr *ownerPr );
96 void
97 MeasVMS__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
98 VirtProcr *newOwnerPr );
100 void
101 MeasVMS__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
103 void
104 MeasVMS__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
106 void
107 MeasVMS__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
111 //=======================
112 void
113 MeasVMS__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
114 VirtProcr *receivePr);
116 void
117 MeasVMS__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
119 void *
120 MeasVMS__receive_type_to( const int type, VirtProcr *receivePr );
122 void *
123 MeasVMS__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
126 //=======================
128 void
129 MeasVMS__free_semantic_request( MeasVMSSemReq *semReq );
132 //========================= Internal use only =============================
133 void
134 MeasVMS__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
136 VirtProcr *
137 MeasVMS__schedule_virt_procr( void *_semEnv, int coreNum );
140 #endif /* _MeasVMS_H */
