view requests.h @ 134:a9b72021f053

Distributed memory management w/o free requests working
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 16 Sep 2011 16:19:24 +0200
parents
children
line source
1 /*
2 * File: requests.h
3 * Author: msach
4 *
5 * Created on September 16, 2011, 3:11 PM
6 */
8 #ifndef REQUESTS_H
9 #define REQUESTS_H
11 #include "ProcrContext.h"
13 typedef struct _InterMasterReqst InterMasterReqst;
15 //============= Requests ===========
16 //
18 //VMS Request is the carrier for Slave to Master requests
19 // it has an embedded sub-type request that is pulled out
20 // inside the plugin's request handler
21 enum VMSReqstType //For Slave->Master requests
22 {
23 semantic = 1, //avoid starting enums at 0, for debug reasons
24 createReq,
25 dissipate,
26 VMSSemantic //goes with VMSSemReqst below
27 };
29 struct _VMSReqst
30 {
31 enum VMSReqstType reqType;//used for dissipate and in future for IO requests
32 void *semReqData;
34 VMSReqst *nextReqst;
35 };
36 //VMSReqst
38 //This is a sub-type of Slave->Master requests.
39 // It's for Slaves to invoke built-in VMS-core functions that have language-like
40 // behavior.
41 enum VMSSemReqstType //These are equivalent to semantic requests, but for
42 { // VMS's services available directly to app, like OS
43 createProbe = 1, // and probe services -- like a VMS-wide built-in lang
44 openFile,
45 otherIO
46 };
48 typedef struct
49 { enum VMSSemReqstType reqType;
50 VirtProcr *requestingPr;
51 char *nameStr; //for create probe
52 }
53 VMSSemReq;
55 //These are for Master to Master requests
56 // They get re-cast to the appropriate sub-type of request
57 enum InterMasterReqstType //For Master->Master
58 {
59 destVMSCore = 1, //avoid starting enums at 0, for debug reasons
60 destPlugin
61 };
63 struct _InterMasterReqst //Doing a trick to save space & time -- allocate
64 { // space for a sub-type then cast first as InterMaster then as sub-type
65 enum InterMasterReqstType reqType;
66 InterMasterReqst *nextReqst;
67 };
68 //InterMasterReqst (defined above in typedef block)
71 //These are a sub-type of InterMaster requests. The inter-master req gets
72 // re-cast to be of this type, after checking
73 //This ones for requests between internals of VMS-core.. such as malloc
74 enum InterVMSCoreReqType
75 {
76 transfer_free_ptr = 1 //avoid starting enums at 0, for debug reasons
77 };
79 //Doing a trick to save space & time -- allocate space
80 // for this, cast first as InterMaster then as this
81 typedef struct
82 {
83 enum InterMasterReqstType reqType; //duplicate InterMasterReqst at top
84 InterMasterReqst *nextReqst;
86 enum InterVMSCoreReqType secondReqType;
87 void *freePtr; //pile up fields, add as needed
88 } InterVMSCoreReqst;
90 //This is for requests between plugins on different cores
91 // Here, after casting, the pluginReq is extracted and handed to plugin
92 //Doing a trick to save space & time -- allocate space
93 // for this, cast first as InterMaster then as this
94 typedef struct
95 {
96 enum InterMasterReqstType reqType; //copy InterMasterReqst at top
97 InterMasterReqst *nextReqst;
99 void *pluginReq; //plugin will cast to approp type
100 } InterPluginReqst;
102 #endif /* REQUESTS_H */