big update for forwarding lists and dependency counts, stable compile but seg faults
[IRC.git] / Robust / src / Runtime / mlp_runtime.h
1 #ifndef __MLP_RUNTIME__
2 #define __MLP_RUNTIME__
3
4
5 #include <pthread.h>
6 #include "Queue.h"
7 #include "psemaphore.h"
8
9
10 #ifndef FALSE
11 #define FALSE 0
12 #endif
13
14 #ifndef TRUE
15 #define TRUE 1
16 #endif
17
18
19 // these fields are common to any SESE, and casting the
20 // generated SESE record to this can be used, because
21 // the common structure is always the first item in a
22 // customized SESE record
23 typedef struct SESEcommon_t {  
24
25   // the identifier for the class of sese's that
26   // are instances of one particular static code block
27   int classID;
28
29   // a parent waits on this semaphore when stalling on
30   // this child, the child gives it at its SESE exit
31   psemaphore stallSem;
32
33   // the lock guards the following data SESE's
34   // use to coordinate with one another
35   pthread_mutex_t lock;
36   struct Queue*   forwardList;
37   int             unresolvedDependencies;
38   int             doneExecuting;
39
40 } SESEcommon;
41
42
43 /*
44 // a parent remembers an SESE instance, say class ID=2
45 // and age=0, by declaring an SESEvarSrc seseID2_age0
46 // and keeping the fields up-to-date
47 typedef struct SESEvarSrc_t {
48   void*  sese;
49   INTPTR addr;
50 } SESEvarSrc;
51 */
52
53
54 // simple mechanical allocation and 
55 // deallocation of SESE records
56 void* mlpCreateSESErecord( int size );
57 void  mlpDestroySESErecord( void* seseRecord );
58
59
60 // main library functions
61 /*
62 void mlpInit();
63 void mlpCommonIssueActions( void* seseRecord );
64 void mlpStall( void* seseRecord );
65 */
66
67 #endif /* __MLP_RUNTIME__ */