Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VSs_impls > VSs__MC_shared_impl
comparison VSs.h @ 40:df464a215387
add implementations of (some) nanos api functions
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Mon, 03 Jun 2013 18:49:19 +0200 |
| parents | a951b38d2cfc |
| children | 37bb39da5ff1 |
comparison
equal
deleted
inserted
replaced
| 30:315a0286ccdc | 31:d0213ae02d42 |
|---|---|
| 56 #define SEED_SLV NULL | 56 #define SEED_SLV NULL |
| 57 | 57 |
| 58 typedef struct | 58 typedef struct |
| 59 { | 59 { |
| 60 VSsTaskFnPtr fn; | 60 VSsTaskFnPtr fn; |
| 61 int32 numTotalArgs;//the number of inputs to function | 61 int32 numDeps;//how many of args have dependencies |
| 62 int32 numCtldArgs;//how many of args have dependencies | 62 int32 *depsTypes; //says reader, writer, or non-ctld |
| 63 int32 *argTypes; //says reader, writer, or non-ctld | 63 size_t *depsSizes; //for detecting overlap |
| 64 int32 *argSizes; //for detecting overlap | |
| 65 int32 sizeOfArgs; //for memcpy of args struct | 64 int32 sizeOfArgs; //for memcpy of args struct |
| 66 } | 65 } |
| 67 VSsTaskType; | 66 VSsTaskType; |
| 68 | 67 |
| 69 | 68 |
| 78 #endif | 77 #endif |
| 79 } | 78 } |
| 80 VSsPointerEntry; | 79 VSsPointerEntry; |
| 81 | 80 |
| 82 typedef struct { | 81 typedef struct { |
| 83 void **args; //ctld args must come first, as ptrs | 82 void **args; //for calling only, can contain values |
| 83 void** depsAddrs; //pointers only | |
| 84 VSsTaskType *taskType; | 84 VSsTaskType *taskType; |
| 85 int32 *taskID; | 85 int32 *taskID; |
| 86 int32 numBlockingProp; | 86 int32 numBlockingProp; |
| 87 SlaveVP *slaveAssignedTo; //only valid before end task (thread) | 87 SlaveVP *slaveAssignedTo; //only valid before end task (thread) |
| 88 VSsPointerEntry **ptrEntries; | 88 VSsPointerEntry **ptrEntries; |
| 90 int32 numLiveChildTasks; | 90 int32 numLiveChildTasks; |
| 91 int32 numLiveChildThreads; | 91 int32 numLiveChildThreads; |
| 92 bool32 isWaitingForChildTasksToEnd; | 92 bool32 isWaitingForChildTasksToEnd; |
| 93 bool32 isWaitingForChildThreadsToEnd; | 93 bool32 isWaitingForChildThreadsToEnd; |
| 94 bool32 isEnded; | 94 bool32 isEnded; |
| 95 int *argsMask; | 95 int *depsMask; |
| 96 #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC | 96 #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC |
| 97 Unit parentUnit; | 97 Unit parentUnit; |
| 98 Unit firstOfTask; | 98 Unit firstOfTask; |
| 99 #endif | 99 #endif |
| 100 } | 100 } |
| 177 struct _VSsSemReq | 177 struct _VSsSemReq |
| 178 { enum VSsReqType reqType; | 178 { enum VSsReqType reqType; |
| 179 SlaveVP *callingSlv; | 179 SlaveVP *callingSlv; |
| 180 VSsTaskType *taskType; | 180 VSsTaskType *taskType; |
| 181 void *args; | 181 void *args; |
| 182 void *deps; | |
| 182 VSsTaskStub *taskStub; | 183 VSsTaskStub *taskStub; |
| 183 | 184 |
| 184 SlaveVP *senderSlv; | 185 SlaveVP *senderSlv; |
| 185 SlaveVP *receiverSlv; | 186 SlaveVP *receiverSlv; |
| 186 int32 *senderID; | 187 int32 *senderID; |
| 202 | 203 |
| 203 PtrToAtomicFn fnToExecInMaster; | 204 PtrToAtomicFn fnToExecInMaster; |
| 204 void *dataForFn; | 205 void *dataForFn; |
| 205 | 206 |
| 206 int32 transID; | 207 int32 transID; |
| 207 int32 criticalID; | 208 void* criticalID; |
| 208 } | 209 } |
| 209 /* VSsSemReq */; | 210 /* VSsSemReq */; |
| 210 | 211 |
| 211 | 212 |
| 212 typedef struct | 213 typedef struct |
| 215 PrivQueueStruc *freeExtraTaskSlvQ; //Shared | 216 PrivQueueStruc *freeExtraTaskSlvQ; //Shared |
| 216 PrivQueueStruc *taskReadyQ; //Shared (tasks not pinned) | 217 PrivQueueStruc *taskReadyQ; //Shared (tasks not pinned) |
| 217 SlaveVP *slotTaskSlvs[NUM_CORES][NUM_ANIM_SLOTS]; | 218 SlaveVP *slotTaskSlvs[NUM_CORES][NUM_ANIM_SLOTS]; |
| 218 HashTable *argPtrHashTbl; | 219 HashTable *argPtrHashTbl; |
| 219 HashTable *commHashTbl; | 220 HashTable *commHashTbl; |
| 221 HashTable *criticalHashTbl; | |
| 220 int32 numLiveExtraTaskSlvs; | 222 int32 numLiveExtraTaskSlvs; |
| 221 int32 numLiveThreadSlvs; | 223 int32 numLiveThreadSlvs; |
| 222 int32 nextCoreToGetNewSlv; | 224 int32 nextCoreToGetNewSlv; |
| 223 int32 primitiveStartTime; | 225 int32 primitiveStartTime; |
| 224 | 226 |
| 225 //fix limit on num with dynArray | 227 //fix limit on num with dynArray |
| 226 VSsSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; | 228 VSsSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; |
| 227 VSsTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; | 229 VSsTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; |
| 228 VSsCritical criticalSection[NUM_STRUCS_IN_SEM_ENV]; | 230 |
| 229 | 231 |
| 230 bool32 *coreIsDone; | 232 bool32 *coreIsDone; |
| 231 int32 numCoresDone; | 233 int32 numCoresDone; |
| 232 | 234 |
| 233 int numInFlightTasks; | 235 int numInFlightTasks; |
| 329 #define VSs__free(ptrToFree, callingSlave ) VMS_App__free( ptrToFree, callingSlave ) | 331 #define VSs__free(ptrToFree, callingSlave ) VMS_App__free( ptrToFree, callingSlave ) |
| 330 | 332 |
| 331 | 333 |
| 332 //======================= | 334 //======================= |
| 333 void | 335 void |
| 334 VSs__submit_task( VSsTaskType *taskType, void *args); | 336 VSs__submit_task( VSsTaskType *taskType, void *args, void* deps); |
| 335 | 337 |
| 336 int32 * | 338 int32 * |
| 337 VSs__create_taskID_of_size( int32 numInts); | 339 VSs__create_taskID_of_size( int32 numInts); |
| 338 | 340 |
| 339 void | 341 void |
| 340 VSs__submit_task_with_ID( VSsTaskType *taskType, void *args, int32 *taskID); | 342 VSs__submit_task_with_ID( VSsTaskType *taskType, void *args, void* deps, int32 *taskID); |
| 341 | 343 |
| 342 void VSs__run_task(TopLevelFnPtr fnPtr, void *initData); | 344 void VSs__run_task(TopLevelFnPtr fnPtr, void *initData); |
| 343 | 345 |
| 344 void | 346 void |
| 345 VSs__end_task(); | 347 VSs__end_task(); |
| 350 | 352 |
| 351 void | 353 void |
| 352 VSs__taskwait_on(void* ptr); | 354 VSs__taskwait_on(void* ptr); |
| 353 | 355 |
| 354 void | 356 void |
| 355 VSs__start_critical(int32 name); | 357 VSs__start_critical(void* name); |
| 356 | 358 |
| 357 void | 359 void |
| 358 VSs__end_critical(int32 name); | 360 VSs__end_critical(void* name); |
| 359 | 361 |
| 360 int32 * | 362 int32 * |
| 361 VSs__give_self_taskID(); | 363 VSs__give_self_taskID(); |
| 362 | 364 |
| 363 void | 365 void |
