1 #ifndef __MLP_RUNTIME__
2 #define __MLP_RUNTIME__
9 // a forward delcaration for SESEvar
13 typedef struct SESEvar_t {
16 // the value when it is known will be placed
17 // in this location, which can be accessed
18 // as a variety of types
24 long long sesetype_long;
27 double sesetype_double;
28 void* sesetype_object;
31 // a statically or dynamically known SESE
32 // to gather the variable's value from
33 // if source==NULL it indicates the root
34 // SESE, which has no record, just normal
36 //struct SESErecord_t* source;
41 typedef struct SESErecord_t {
42 // the identifier for the class of sese's that
43 // are instances of one particular static code block
46 // not globally unqiue, but each parent ensures that
47 // its children have unique identifiers, including to
51 // used to give out IDs to children
54 // pointers to SESEs directly above or below
56 struct SESErecord_t* parent;
57 struct Queue* childrenList;
59 // for state of vars after issue
62 // when this sese is ready to be invoked,
63 // allocate and fill in this structure, and
64 // the primitives will be passed out of the
65 // above var array at the call site
68 // for signaling transition from issue
70 pthread_cond_t* startCondVar;
71 pthread_mutex_t* startCondVarLock;
74 // use a list of SESErecords and a lock to let
75 // consumers tell this SESE who wants values
77 pthread_mutex_t* forwardListLock;
78 struct Queue* forwardList;
84 typedef struct invokeSESEargs_t {
91 // simple mechanical allocation and deallocation
93 SESErecord* mlpCreateSESErecord( int classID,
100 void mlpDestroySESErecord( SESErecord* sese );
103 // main library functions
106 SESErecord* mlpGetCurrent();
107 SESErecord* mlpSchedule();
109 void mlpIssue ( SESErecord* sese );
110 void mlpStall ( SESErecord* sese );
111 void mlpNotifyExit( SESErecord* sese );
114 extern SESErecord* rootsese;
117 #endif /* __MLP_RUNTIME__ */