diff SSR.h @ 21:ad29ff7a0209

Buggy version of singltons -- data plus Fn singletons now -- about to fix
author Me
date Sat, 13 Nov 2010 14:38:33 -0800
parents 562e68094af7
children fef69b887df4
line diff
     1.1 --- a/SSR.h	Fri Nov 12 08:43:20 2010 -0800
     1.2 +++ b/SSR.h	Sat Nov 13 14:38:33 2010 -0800
     1.3 @@ -27,6 +27,23 @@
     1.4  /*Semantic layer-specific data sent inside a request from lib called in app
     1.5   * to request handler called in MasterLoop
     1.6   */
     1.7 +
     1.8 +typedef struct
     1.9 + {
    1.10 +   VirtProcr      *VPCurrentlyExecuting;
    1.11 +   PrivQueueStruc *waitingVPQ;
    1.12 + }
    1.13 +SSRTrans;
    1.14 +
    1.15 +typedef struct
    1.16 + {
    1.17 +   int32           hasBeenStarted;
    1.18 +   int32           hasFinished;
    1.19 +   void           *endInstrAddr;
    1.20 +   PrivQueueStruc *waitQ;
    1.21 + }
    1.22 +SSRSingleton;
    1.23 +
    1.24  enum SSRReqType
    1.25   {
    1.26     send_type = 1,
    1.27 @@ -38,7 +55,10 @@
    1.28     transfer_out,
    1.29     malloc_req,
    1.30     free_req,
    1.31 -   singleton,
    1.32 +   singleton_fn_start,
    1.33 +   singleton_fn_end,
    1.34 +   singleton_data_start,
    1.35 +   singleton_data_end,
    1.36     atomic,
    1.37     trans_start,
    1.38     trans_end
    1.39 @@ -60,7 +80,7 @@
    1.40     void              *ptrToFree;
    1.41  
    1.42     int32              singletonID;
    1.43 -   void              *endJumpPt;
    1.44 +   SSRSingleton     **singletonAddr;
    1.45  
    1.46     PtrToAtomicFn      fnToExecInMaster;
    1.47     void              *dataForFn;
    1.48 @@ -72,13 +92,6 @@
    1.49  
    1.50  typedef struct
    1.51   {
    1.52 -   VirtProcr      *VPCurrentlyExecuting;
    1.53 -   PrivQueueStruc *waitingVPQ;
    1.54 - }
    1.55 -SSRTrans;
    1.56 -
    1.57 -typedef struct
    1.58 - {
    1.59     PrivQueueStruc **readyVPQs;
    1.60     HashTable       *commHashTbl;
    1.61     int32            numVirtPr;
    1.62 @@ -86,7 +99,7 @@
    1.63     int32            primitiveStartTime;
    1.64  
    1.65                         //fix limit on num with dynArray
    1.66 -   int32            singletonHasBeenExecutedFlags[NUM_STRUCS_IN_SEM_ENV];
    1.67 +   SSRSingleton     fnSingletons[NUM_STRUCS_IN_SEM_ENV];
    1.68     SSRTrans         transactionStrucs[NUM_STRUCS_IN_SEM_ENV];
    1.69   }
    1.70  SSRSemEnv;
    1.71 @@ -187,8 +200,16 @@
    1.72  
    1.73  //======================= Concurrency Stuff ======================
    1.74  void
    1.75 -SSR__start_singleton( int32 singletonID, void *endSingletonLabelAddr,
    1.76 -                      VirtProcr *animPr );
    1.77 +SSR__start_fn_singleton( int32 singletonID, VirtProcr *animPr );
    1.78 +
    1.79 +void
    1.80 +SSR__end_fn_singleton( int32 singletonID, VirtProcr *animPr );
    1.81 +
    1.82 +void
    1.83 +SSR__start_data_singleton( SSRSingleton **singeltonAddr, VirtProcr *animPr );
    1.84 +
    1.85 +void
    1.86 +SSR__end_data_singleton( SSRSingleton **singletonAddr, VirtProcr *animPr );
    1.87  
    1.88  void
    1.89  SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,