view MeasVMS.h @ 3:405a1b793325

Some histogram stuff -- have feeling will go away when merge with VMS Nov 8
author SeanHalle
date Thu, 11 Nov 2010 05:34:50 -0800
parents a99b99c2b814
children
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 }
56 MeasVMSSemEnv;
59 typedef struct
60 {
61 Histogram *suspHist;
62 Histogram *masterTimeHist;
63 Histogram *masterLockHist;
64 Histogram *createHist;
65 }
66 HistCarrier;
69 //===========================================================================
71 //===========================================================================
73 void
74 MeasVMS__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
76 //=======================
78 void
79 MeasVMS__init();
81 void
82 MeasVMS__cleanup_after_shutdown();
84 //=======================
86 inline VirtProcr *
87 MeasVMS__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
88 VirtProcr *creatingPr );
90 void
91 MeasVMS__dissipate_procr( VirtProcr *procrToDissipate );
93 //=======================
94 void *
95 MeasVMS__malloc_size_to( int numBytes, VirtProcr *ownerPr );
97 void
98 MeasVMS__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
99 VirtProcr *newOwnerPr );
101 void
102 MeasVMS__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
104 void
105 MeasVMS__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
107 void
108 MeasVMS__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
112 //=======================
113 void
114 MeasVMS__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
115 VirtProcr *receivePr);
117 void
118 MeasVMS__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
120 void *
121 MeasVMS__receive_type_to( const int type, VirtProcr *receivePr );
123 void *
124 MeasVMS__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
127 //=======================
129 void
130 MeasVMS__free_semantic_request( MeasVMSSemReq *semReq );
133 //========================= Internal use only =============================
134 void
135 MeasVMS__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
137 VirtProcr *
138 MeasVMS__schedule_virt_procr( void *_semEnv, int coreNum );
141 #endif /* _MeasVMS_H */