comparison VMS.h @ 135:0b49fd35afc1

distributed free working -app sends a VMSSemReqst to his Master which send a request to a different Master -Master send the request directly -The request structure is freed by the sender, when the request was handled There are still problems on shutdown. The shutdownVPs are all allocated by one Master which is likly to be terminated
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 16 Sep 2011 20:08:28 +0200
parents a9b72021f053
children 99343ffe1918
comparison
equal deleted inserted replaced
59:9f10cf3c4f81 60:79123c59d511
16 #include "Queue_impl/PrivateQueue.h" 16 #include "Queue_impl/PrivateQueue.h"
17 #include "Histogram/Histogram.h" 17 #include "Histogram/Histogram.h"
18 #include "DynArray/DynArray.h" 18 #include "DynArray/DynArray.h"
19 #include "Hash_impl/PrivateHash.h" 19 #include "Hash_impl/PrivateHash.h"
20 #include "vmalloc.h" 20 #include "vmalloc.h"
21 #include "requests.h" 21 #include "inter_VMS_requests.h"
22 22
23 //=============================== Debug =================================== 23 //=============================== Debug ===================================
24 // 24 //
25 //When SEQUENTIAL is defined, VMS does sequential exe in the main thread 25 //When SEQUENTIAL is defined, VMS does sequential exe in the main thread
26 // It still does co-routines and all the mechanisms are the same, it just 26 // It still does co-routines and all the mechanisms are the same, it just
116 116
117 typedef VirtProcr * (*SlaveScheduler) ( void *, int ); //semEnv, coreIdx 117 typedef VirtProcr * (*SlaveScheduler) ( void *, int ); //semEnv, coreIdx
118 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv 118 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv
119 typedef void (*ResumePrFnPtr) ( VirtProcr *, void * ); 119 typedef void (*ResumePrFnPtr) ( VirtProcr *, void * );
120 120
121 //============= Requests ===========
122 //
123
124 //VMS Request is the carrier for Slave to Master requests
125 // it has an embedded sub-type request that is pulled out
126 // inside the plugin's request handler
127 enum VMSReqstType //For Slave->Master requests
128 {
129 semantic = 1, //avoid starting enums at 0, for debug reasons
130 createReq,
131 dissipate,
132 VMSSemantic //goes with VMSSemReqst below
133 };
134
135 struct _VMSReqst
136 {
137 enum VMSReqstType reqType;//used for dissipate and in future for IO requests
138 void *semReqData;
139
140 VMSReqst *nextReqst;
141 };
142 //VMSReqst
143
144 //This is a sub-type of Slave->Master requests.
145 // It's for Slaves to invoke built-in VMS-core functions that have language-like
146 // behavior.
147 enum VMSSemReqstType //These are equivalent to semantic requests, but for
148 { // VMS's services available directly to app, like OS
149 createProbe = 1, // and probe services -- like a VMS-wide built-in lang
150 openFile,
151 otherIO,
152 interMasterReqst
153 };
154
155 typedef struct
156 { enum VMSSemReqstType reqType;
157 //VirtProcr *requestingPr;
158 int receiverID; //for inter master requests
159 void *data;
160 }
161 VMSSemReq;
162
121 163
122 //==================== Core data structures =================== 164 //==================== Core data structures ===================
123 165
124 /*Master Env is the only global variable -- has entry points for any other 166 /*Master Env is the only global variable -- has entry points for any other
125 * data needed. 167 * data needed.
147 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP 189 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP
148 GateStruc *workStealingGates[NUM_CORES]; //concurrent work-steal 190 GateStruc *workStealingGates[NUM_CORES]; //concurrent work-steal
149 int32 workStealingLock; 191 int32 workStealingLock;
150 192
151 InterMasterReqst* interMasterRequestsFor[NUM_CORES]; 193 InterMasterReqst* interMasterRequestsFor[NUM_CORES];
194 InterMasterReqst* interMasterRequestsSentBy[NUM_CORES];
152 RequestHandler interPluginReqHdlr; 195 RequestHandler interPluginReqHdlr;
153 196
154 int32 numProcrsCreated; //gives ordering to processor creation 197 int32 numProcrsCreated; //gives ordering to processor creation
155 198
156 int32 currentMasterProcrID; 199 int32 currentMasterProcrID;