An implementation of parent/child stalling that compiles but hangs during execution...
[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 // forward delcarations
11 //struct SESErecord_t;
12
13
14 // note that this record is never used other than
15 // to cast a customized record and have easy access
16 // the common fields listed here
17 typedef struct SESErecord_t {  
18
19   // the identifier for the class of sese's that
20   // are instances of one particular static code block
21   int classID;
22
23   // a parent waits on this semaphore when stalling on
24   // this child, the child gives it at its SESE exit
25   psemaphore stallSem;
26
27   // the lock guards the following data SESE's
28   // use to coordinate with one another
29   pthread_mutex_t lock;
30   struct Queue*   forwardList;
31   int             doneExecuting;
32
33 } SESErecord;
34
35
36 /*
37 // a parent remembers an SESE instance, say class ID=2
38 // and age=0, by declaring an SESEvarSrc seseID2_age0
39 // and keeping the fields up-to-date
40 typedef struct SESEvarSrc_t {
41   void*  sese;
42   INTPTR addr;
43 } SESEvarSrc;
44 */
45
46
47 // simple mechanical allocation and 
48 // deallocation of SESE records
49 void* mlpCreateSESErecord( int classID, int size );
50 void  mlpDestroySESErecord( void* seseRecord );
51
52
53 // main library functions
54 void mlpInit();
55 void mlpIssue( void* seseRecord );
56 void mlpStall( void* seseRecord );
57
58
59 #endif /* __MLP_RUNTIME__ */