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
69 pthread_cond_t* startCondVar;
70 pthread_mutex_t* startCondVarLock;
73 // use a list of SESErecords and a lock to let
74 // consumers tell this SESE who wants values
76 pthread_mutex_t* forwardListLock;
77 struct Queue* forwardList;
82 typedef struct invokeSESEargs_t {
89 // simple mechanical allocation and deallocation
91 SESErecord* mlpCreateSESErecord( int classID,
98 void mlpDestroySESErecord( SESErecord* sese );
101 // main library functions
104 SESErecord* mlpGetCurrent();
105 SESErecord* mlpSchedule();
107 void mlpIssue ( SESErecord* sese );
108 void mlpStall ( SESErecord* sese );
109 void mlpNotifyExit( SESErecord* sese );
112 extern SESErecord* rootsese;
115 #endif /* __MLP_RUNTIME__ */