diff VSs.h @ 8:eb3d77ca9f59

Code complete -- not debuggedd yet
author Sean Halle <seanhalle@yahoo.com>
date Thu, 02 Aug 2012 01:03:14 -0700
parents 3999b8429ddd
children 832bc715fbf2
line diff
     1.1 --- a/VSs.h	Wed Aug 01 03:16:27 2012 -0700
     1.2 +++ b/VSs.h	Thu Aug 02 01:03:14 2012 -0700
     1.3 @@ -41,6 +41,10 @@
     1.4  #define READER  1  /*Trick -- READER same as IN*/
     1.5  #define WRITER  2  /*Trick -- WRITER same as OUT and INOUT*/
     1.6  
     1.7 +#define IS_A_THREAD NULL
     1.8 +#define IS_ENDED    NULL
     1.9 +#define SEED_SLV    NULL
    1.10 +
    1.11  typedef struct
    1.12   {
    1.13     VSsTaskFnPtr fn;
    1.14 @@ -69,22 +73,15 @@
    1.15     int32        numBlockingProp;
    1.16     SlaveVP     *slaveAssignedTo;
    1.17     VSsPointerEntry  **ptrEntries;
    1.18 -   void*        parent;
    1.19 -   bool32       parentIsTask;
    1.20 -   int32        numChildTasks;
    1.21 -   bool32       isWaiting;
    1.22 +   void*        parentTasksStub;
    1.23 +   int32        numLiveChildTasks;
    1.24 +   int32        numLiveChildThreads;
    1.25 +   bool32       isWaitingForChildTasksToEnd;
    1.26 +   bool32       isWaitingForChildThreadsToEnd;
    1.27 +   bool32       isEnded;
    1.28   }
    1.29  VSsTaskStub;
    1.30  
    1.31 -typedef struct 
    1.32 - {
    1.33 -    void* parent;
    1.34 -    bool32       parentIsTask;
    1.35 -    int32        numChildTasks;
    1.36 -    bool32       isWaiting;
    1.37 -   SlaveVP     *slaveAssignedTo;    
    1.38 - }
    1.39 -VSsThreadInfo;
    1.40  
    1.41  typedef struct
    1.42   {
    1.43 @@ -186,12 +183,13 @@
    1.44  typedef struct
    1.45   {
    1.46     PrivQueueStruc **slavesReadyToResumeQ; //Shared (slaves not pinned)
    1.47 -   PrivQueueStruc **extraTaskSlvQ;     //Shared
    1.48 +   PrivQueueStruc **freeExtraTaskSlvQ;     //Shared
    1.49     PrivQueueStruc  *taskReadyQ;        //Shared (tasks not pinned)
    1.50     SlaveVP         *currTaskSlvs[NUM_CORES][NUM_ANIM_SLOTS];
    1.51     HashTable       *argPtrHashTbl;
    1.52     HashTable       *commHashTbl;
    1.53 -   int32            numAdditionalSlvs;
    1.54 +   int32            numLiveExtraTaskSlvs;
    1.55 +   int32            numLiveThreadSlvs;
    1.56     int32            nextCoreToGetNewSlv;
    1.57     int32            primitiveStartTime;
    1.58  
    1.59 @@ -230,7 +228,11 @@
    1.60   };
    1.61  //TransListElem
    1.62   
    1.63 - 
    1.64 +enum VSsSlvType
    1.65 + { extraTaskSlv = 1,
    1.66 +   slotTaskSlv,
    1.67 +   threadSlv
    1.68 + };
    1.69   
    1.70  typedef struct
    1.71   {
    1.72 @@ -238,7 +240,7 @@
    1.73     TransListElem *lastTransEntered;
    1.74     bool32         needsTaskAssigned;
    1.75     VSsTaskStub   *taskStub;
    1.76 -   VSsThreadInfo *threadInfo;
    1.77 +   VSsSlvType     slaveType;
    1.78   }
    1.79  VSsSemData;
    1.80   
    1.81 @@ -357,7 +359,7 @@
    1.82                            VSsSemEnv *semEnv,    int32 coreToAssignOnto );
    1.83  
    1.84  VSsTaskStub *
    1.85 -create_expl_proc_task_stub( void *initData );
    1.86 +create_thread_task_stub( void *initData );
    1.87  
    1.88  
    1.89  SlaveVP *