diff 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
line diff
     1.1 --- a/VMS.h	Fri Sep 16 16:19:24 2011 +0200
     1.2 +++ b/VMS.h	Fri Sep 16 20:08:28 2011 +0200
     1.3 @@ -18,7 +18,7 @@
     1.4  #include "DynArray/DynArray.h"
     1.5  #include "Hash_impl/PrivateHash.h"
     1.6  #include "vmalloc.h"
     1.7 -#include "requests.h"
     1.8 +#include "inter_VMS_requests.h"
     1.9  
    1.10  //===============================  Debug  ===================================
    1.11  //
    1.12 @@ -118,6 +118,48 @@
    1.13  typedef void  (*RequestHandler)  ( VirtProcr *, void * ); //prWReqst, semEnv
    1.14  typedef void  (*ResumePrFnPtr)   ( VirtProcr *, void * );
    1.15  
    1.16 +//============= Requests ===========
    1.17 +//
    1.18 +
    1.19 +//VMS Request is the carrier for Slave to Master requests
    1.20 +// it has an embedded sub-type request that is pulled out
    1.21 +// inside the plugin's request handler
    1.22 +enum VMSReqstType   //For Slave->Master requests
    1.23 + { 
    1.24 +   semantic = 1,    //avoid starting enums at 0, for debug reasons
    1.25 +   createReq,
    1.26 +   dissipate,
    1.27 +   VMSSemantic      //goes with VMSSemReqst below
    1.28 + };
    1.29 +
    1.30 +struct _VMSReqst
    1.31 + {
    1.32 +   enum VMSReqstType  reqType;//used for dissipate and in future for IO requests
    1.33 +   void              *semReqData;
    1.34 +
    1.35 +   VMSReqst *nextReqst;
    1.36 + };
    1.37 +//VMSReqst
    1.38 +
    1.39 +//This is a sub-type of Slave->Master requests.
    1.40 +// It's for Slaves to invoke built-in VMS-core functions that have language-like
    1.41 +// behavior.
    1.42 +enum VMSSemReqstType   //These are equivalent to semantic requests, but for
    1.43 + {                     // VMS's services available directly to app, like OS
    1.44 +   createProbe = 1,    // and probe services -- like a VMS-wide built-in lang
    1.45 +   openFile,
    1.46 +   otherIO,
    1.47 +   interMasterReqst
    1.48 + };
    1.49 +
    1.50 +typedef struct
    1.51 + { enum VMSSemReqstType reqType;
    1.52 +   //VirtProcr           *requestingPr;
    1.53 +   int                  receiverID; //for inter master requests
    1.54 +   void                *data;
    1.55 + }
    1.56 +VMSSemReq;
    1.57 +
    1.58  
    1.59  //====================  Core data structures  ===================
    1.60  
    1.61 @@ -149,6 +191,7 @@
    1.62     int32            workStealingLock;
    1.63     
    1.64     InterMasterReqst*  interMasterRequestsFor[NUM_CORES];
    1.65 +   InterMasterReqst*  interMasterRequestsSentBy[NUM_CORES];
    1.66     RequestHandler     interPluginReqHdlr;
    1.67     
    1.68     int32              numProcrsCreated; //gives ordering to processor creation