Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison VMS.h @ 2:02d5a446d506
Compiles with assembly -- warning about jmp w/o '*'?
| author | Me |
|---|---|
| date | Mon, 31 May 2010 14:23:38 -0700 |
| parents | |
| children | 6c518bda83fe |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:dba3068a8e4c |
|---|---|
| 1 /* | |
| 2 * Copyright 2009 OpenSourceStewardshipFoundation.org | |
| 3 * Licensed under GNU General Public License version 2 | |
| 4 * | |
| 5 * Author: seanhalle@yahoo.com | |
| 6 * | |
| 7 */ | |
| 8 | |
| 9 #ifndef _VMS_H | |
| 10 #define _VMS_H | |
| 11 | |
| 12 | |
| 13 #include "VMS_primitive_data_types.h" | |
| 14 #include "Queue_impl/BlockingQueue.h" | |
| 15 | |
| 16 //This value is the number of hardware threads in the shared memory | |
| 17 // machine | |
| 18 #define NUM_WORKERS 4 | |
| 19 #define NUM_SLAVES 8 | |
| 20 | |
| 21 #define SUCCESS 0 | |
| 22 | |
| 23 #define thdAttrs NULL | |
| 24 | |
| 25 typedef struct WorkUnit WorkUnit; | |
| 26 typedef struct VMSProcr VMSProcr; | |
| 27 typedef struct SlaveReqst SlaveReqst; | |
| 28 | |
| 29 typedef bool8 (*SlaveScheduler) ( void * ); | |
| 30 typedef void (*RequestHandler) ( SlaveReqst * ); | |
| 31 | |
| 32 typedef struct | |
| 33 { | |
| 34 QueueStruc *workQ; | |
| 35 unsigned int id; | |
| 36 } | |
| 37 ThdParams; | |
| 38 | |
| 39 //This is application-level data of the scheduler that runs in the master | |
| 40 // virtual processor. This data is at a higher level than the slave data- | |
| 41 // struc, which is part of the virtualization infrastructure.. this | |
| 42 // MasterEnv sits on top of that level | |
| 43 typedef struct | |
| 44 { | |
| 45 VMSProcr virtSlaves[ NUM_SLAVES ]; | |
| 46 VMSProcr virtMaster; | |
| 47 | |
| 48 SlaveScheduler slaveScheduler; | |
| 49 RequestHandler requestHandler; | |
| 50 | |
| 51 int stillRunning; | |
| 52 WorkUnit *masterWorkUnit; | |
| 53 | |
| 54 VMSProcr **scheduledSlaves; | |
| 55 int numScheduled; | |
| 56 | |
| 57 void *OSEventStruc; | |
| 58 void *semanticEnv; | |
| 59 } | |
| 60 MasterEnv; | |
| 61 | |
| 62 | |
| 63 struct WorkUnit | |
| 64 { | |
| 65 VMSProcr *slaveAssignedTo; | |
| 66 void *addrToJumpTo; | |
| 67 void *workData; | |
| 68 | |
| 69 void *pluginSpecific; | |
| 70 }; | |
| 71 | |
| 72 | |
| 73 struct VMSProcr | |
| 74 { | |
| 75 WorkUnit *workUnitToDo; | |
| 76 SlaveReqst *requestsToMaster; | |
| 77 int workIsDone; | |
| 78 int needsWorkAssigned; | |
| 79 }; | |
| 80 | |
| 81 struct SlaveReqst | |
| 82 { | |
| 83 VMSProcr *slaveFrom; | |
| 84 int reqType; | |
| 85 void *reqData; | |
| 86 | |
| 87 SlaveReqst *nextRequest; | |
| 88 }; | |
| 89 | |
| 90 | |
| 91 | |
| 92 void * coreLoop( void *paramsIn ); //standard PThreads fn prototype | |
| 93 | |
| 94 | |
| 95 //===================== Global Vars =================== | |
| 96 | |
| 97 pthread_t coreLoopThds[ NUM_WORKERS ]; // std struc, holds thread info | |
| 98 QueueStruc *workQ; | |
| 99 ThdParams thdParams[ NUM_WORKERS ]; | |
| 100 | |
| 101 MasterEnv *masterEnv; | |
| 102 | |
| 103 | |
| 104 #endif /* _VMS_H */ | |
| 105 |
