Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.hfa

    r431cd4f r5cb51502  
    6969        struct cluster * cltr;
    7070
    71         // Ready Queue state per processor
    72         struct {
    73                 unsigned short its;
    74                 unsigned short itr;
    75                 unsigned id;
    76                 unsigned target;
    77                 unsigned long long int cutoff;
    78         } rdq;
     71        // Id within the cluster
     72        unsigned cltr_id;
    7973
    8074        // Set to true to notify the processor should terminate
     
    146140// Cluster Tools
    147141
    148 // Intrusives lanes which are used by the ready queue
     142// Intrusives lanes which are used by the relaxed ready queue
    149143struct __attribute__((aligned(128))) __intrusive_lane_t;
    150144void  ?{}(__intrusive_lane_t & this);
    151145void ^?{}(__intrusive_lane_t & this);
    152146
    153 // Aligned timestamps which are used by the relaxed ready queue
    154 struct __attribute__((aligned(128))) __timestamp_t;
    155 void  ?{}(__timestamp_t & this);
    156 void ^?{}(__timestamp_t & this);
     147// Counter used for wether or not the lanes are all empty
     148struct __attribute__((aligned(128))) __snzi_node_t;
     149struct __snzi_t {
     150        unsigned mask;
     151        int root;
     152        __snzi_node_t * nodes;
     153};
     154
     155void  ?{}( __snzi_t & this, unsigned depth );
     156void ^?{}( __snzi_t & this );
    157157
    158158//TODO adjust cache size to ARCHITECTURE
    159159// Structure holding the relaxed ready queue
    160160struct __ready_queue_t {
     161        // Data tracking how many/which lanes are used
     162        // Aligned to 128 for cache locality
     163        __snzi_t snzi;
     164
    161165        // Data tracking the actual lanes
    162166        // On a seperate cacheline from the used struct since
     
    167171                __intrusive_lane_t * volatile data;
    168172
    169                 // Array of times
    170                 __timestamp_t * volatile tscs;
    171 
    172173                // Number of lanes (empty or not)
    173174                volatile size_t count;
     
    179180
    180181// Idle Sleep
    181 struct __cluster_proc_list {
     182struct __cluster_idles {
    182183        // Spin lock protecting the queue
    183184        volatile uint64_t lock;
     
    190191
    191192        // List of idle processors
    192         dlist(processor, processor) idles;
    193 
    194         // List of active processors
    195         dlist(processor, processor) actives;
     193        dlist(processor, processor) list;
    196194};
    197195
     
    209207
    210208        // List of idle processors
    211         __cluster_proc_list procs;
     209        __cluster_idles idles;
    212210
    213211        // List of threads
Note: See TracChangeset for help on using the changeset viewer.