diff VMS.h @ 26:668278fa7a63

Sequential -- just starting to add sequential version
author Me
date Mon, 26 Jul 2010 15:25:53 -0700
parents c556193f7211
children 8b9e4c333fe6
line diff
     1.1 --- a/VMS.h	Sat Jul 24 08:58:47 2010 -0700
     1.2 +++ b/VMS.h	Mon Jul 26 15:25:53 2010 -0700
     1.3 @@ -12,7 +12,7 @@
     1.4  
     1.5  #include "VMS_primitive_data_types.h"
     1.6  #include "Queue_impl/BlockingQueue.h"
     1.7 -#include "pthread.h"
     1.8 +#include <pthread.h>
     1.9  
    1.10     //This value is the number of hardware threads in the shared memory
    1.11     // machine
    1.12 @@ -22,14 +22,19 @@
    1.13  #define NUM_SCHED_SLOTS  (2 * NUM_CORES + 1)
    1.14  
    1.15     //128K stack.. compromise, want 10K virtPr
    1.16 -#define VIRT_PROCR_STACK_SIZE 0x100000
    1.17 +#define VIRT_PROCR_STACK_SIZE 0x10000
    1.18  
    1.19  #define SUCCESS 0
    1.20  
    1.21 +#define writeVMSQ     writePThdQ
    1.22 +#define readVMSQ      readPThdQ
    1.23 +#define makeVMSQ      makePThdQ
    1.24 +#define VMSQueueStruc PThdQueueStruc
    1.25 +
    1.26  //#define thdAttrs NULL  //For PThreads
    1.27  
    1.28  typedef struct _SchedSlot  SchedSlot;
    1.29 -typedef struct _VMSReqst VMSReqst;
    1.30 +typedef struct _VMSReqst   VMSReqst;
    1.31  typedef struct _VirtProcr  VirtProcr;
    1.32  
    1.33  typedef VirtProcr * (*SlaveScheduler)  ( void * );        //semEnv
    1.34 @@ -103,9 +108,9 @@
    1.35     
    1.36     SchedSlot **schedSlots;
    1.37     SchedSlot **filledSlots;
    1.38 -   int         numFilled;
    1.39 +   int         numToPrecede;
    1.40     
    1.41 -   int         stillRunning;
    1.42 +   volatile int stillRunning;
    1.43     
    1.44     VirtProcr  *masterVirtPr;
    1.45  
    1.46 @@ -114,9 +119,7 @@
    1.47  
    1.48     void       *coreLoopShutDownPt; //addr to jump to to shut down a coreLoop
    1.49  
    1.50 -   int             setupComplete;
    1.51 -   pthread_mutex_t suspend_mutex;
    1.52 -   pthread_cond_t  suspend_cond;
    1.53 +   int         setupComplete;
    1.54   }
    1.55  MasterEnv;
    1.56  
    1.57 @@ -130,15 +133,17 @@
    1.58  //=====================  Global Vars ===================
    1.59  
    1.60  
    1.61 -pthread_t   coreLoopThdHandles[ NUM_CORES ];  //pthread's virt-procr state
    1.62 -ThdParams   *coreLoopThdParams[ NUM_CORES ];
    1.63 +pthread_t       coreLoopThdHandles[ NUM_CORES ];  //pthread's virt-procr state
    1.64 +ThdParams      *coreLoopThdParams [ NUM_CORES ];
    1.65 +pthread_mutex_t suspendLock;
    1.66 +pthread_cond_t  suspend_cond;
    1.67  
    1.68  volatile MasterEnv      *_VMSMasterEnv;
    1.69  
    1.70     //workQ is global, static, and volatile so that core loop has its location
    1.71     // hard coded, and reloads every time through the loop -- that way don't
    1.72     // need to save any regs used by core loop
    1.73 -volatile CASQueueStruc  *_VMSWorkQ;
    1.74 +volatile VMSQueueStruc  *_VMSWorkQ;
    1.75  
    1.76  //==========================
    1.77  void