1 #ifndef __MLP_RUNTIME__
2 #define __MLP_RUNTIME__
9 // forward delcarations
11 struct invokeSESEargs_t;
14 typedef struct SESEvar_t {
17 // the value when it is known will be placed
18 // in this location, which can be accessed
19 // as a variety of types
25 long long sesetype_long;
28 double sesetype_double;
29 void* sesetype_object;
32 // a statically or dynamically known SESE
33 // to gather the variable's value from
34 // if source==NULL it indicates the root
35 // SESE, which has no record, just normal
37 //struct SESErecord_t* source;
42 typedef struct SESErecord_t {
43 // the identifier for the class of sese's that
44 // are instances of one particular static code block
48 /* JUST USE POINTER TO SESErecord AS INSTANCE ID
49 // not globally unqiue, but each parent ensures that
50 // its children have unique identifiers, including to
54 // used to give out IDs to children
58 // pointers to SESEs directly above or below
60 struct SESErecord_t* parent;
61 struct Queue* childrenList;
63 // for state of vars after issue
66 // when this sese is ready to be invoked,
67 // allocate and fill in this structure, and
68 // the primitives will be passed out of the
69 // above var array at the call site
72 // for signaling transition from issue
74 pthread_cond_t* startCondVar;
75 pthread_mutex_t* startCondVarLock;
78 // use a list of SESErecords and a lock to let
79 // consumers tell this SESE who wants values
81 pthread_mutex_t* forwardListLock;
82 struct Queue* forwardList;
88 typedef struct invokeSESEargs_t {
95 // simple mechanical allocation and deallocation
97 SESErecord* mlpCreateSESErecord( int classID,
104 void mlpDestroySESErecord( SESErecord* sese );
107 // main library functions
110 SESErecord* mlpGetCurrent();
111 SESErecord* mlpSchedule();
113 void mlpIssue ( SESErecord* sese );
114 void mlpStall ( SESErecord* sese );
115 void mlpNotifyExit( SESErecord* sese );
118 extern SESErecord* rootsese;
121 #endif /* __MLP_RUNTIME__ */