1 #ifndef __MLP_RUNTIME__
2 #define __MLP_RUNTIME__
7 #include "psemaphore.h"
10 // forward delcarations
12 struct invokeSESEargs_t;
15 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;
33 typedef struct SESErecord_t {
34 // the identifier for the class of sese's that
35 // are instances of one particular static code block
38 // for state of vars after issue
41 // when this sese is ready to be invoked,
42 // allocate and fill in this structure, and
43 // the primitives will be passed out of the
44 // above var array at the call site
48 // for signaling transition from issue
50 pthread_cond_t* startCondVar;
51 pthread_mutex_t* startCondVarLock;
55 // this will not be generally sufficient, but
56 // use a semaphore to let a child resume this
57 // parent when stall dependency is satisfied
60 // use a list of SESErecords and a lock to let
61 // consumers tell this SESE who wants values
63 pthread_mutex_t forwardListLock;
64 struct Queue* forwardList;
70 typedef struct invokeSESEargs_t {
77 // simple mechanical allocation and deallocation
79 SESErecord* mlpCreateSESErecord( int classID,
84 void mlpDestroySESErecord( SESErecord* sese );
87 // main library functions
90 //SESErecord* mlpGetCurrent();
91 SESErecord* mlpSchedule();
93 void mlpIssue ( SESErecord* sese );
94 void mlpStall ( SESErecord* sese );
95 void mlpNotifyExit( SESErecord* sese );
98 extern SESErecord* rootsese;
101 #endif /* __MLP_RUNTIME__ */