1 #ifndef __MLP_RUNTIME__
2 #define __MLP_RUNTIME__
9 // forward delcarations
11 struct invokeSESEargs_t;
14 typedef struct SESEvar_t {
15 // the value when it is known will be placed
16 // in this location, which can be accessed
17 // as a variety of types
23 long long sesetype_long;
26 double sesetype_double;
27 void* sesetype_object;
32 typedef struct SESErecord_t {
33 // the identifier for the class of sese's that
34 // are instances of one particular static code block
37 // pointers to SESEs directly above or below
39 //struct SESErecord_t* parent;
40 //struct Queue* childrenList;
41 // IMPLEMENT THIS LIKE STALLS--EVERY PARENTS EXIT MUST
42 // "STALL" on COMPLETETION OF ALL ISSUED CHILDREN, SO
43 // ALWAYS GIVE A CHILD A SEMAPHORE THAT IS ON YOUR LIST
44 // OF THINGS TO BLOCK ON AT EXIT
46 // for state of vars after issue
49 // when this sese is ready to be invoked,
50 // allocate and fill in this structure, and
51 // the primitives will be passed out of the
52 // above var array at the call site
55 // for signaling transition from issue
57 pthread_cond_t* startCondVar;
58 pthread_mutex_t* startCondVarLock;
61 // use a list of SESErecords and a lock to let
62 // consumers tell this SESE who wants values
64 pthread_mutex_t* forwardListLock;
65 struct Queue* forwardList;
71 typedef struct invokeSESEargs_t {
78 // simple mechanical allocation and deallocation
80 SESErecord* mlpCreateSESErecord( int classID,
87 void mlpDestroySESErecord( SESErecord* sese );
90 // main library functions
93 SESErecord* mlpGetCurrent();
94 SESErecord* mlpSchedule();
96 void mlpIssue ( SESErecord* sese );
97 void mlpStall ( SESErecord* sese );
98 void mlpNotifyExit( SESErecord* sese );
101 extern SESErecord* rootsese;
104 #endif /* __MLP_RUNTIME__ */