Ignore:
Timestamp:
May 15, 2018, 4:17:15 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
2e5fa345
Parents:
7d0a3ba (diff), a61fa0bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    r7d0a3ba r358cba0  
    4040
    4141//-----------------------------------------------------------------------------
    42 // Cluster
    43 struct cluster {
    44         // Ready queue locks
    45         __spinlock_t ready_queue_lock;
     42// Processor
     43extern struct cluster * mainCluster;
    4644
    47         // Ready queue for threads
    48         __queue_t(thread_desc) ready_queue;
    49 
    50         // Name of the cluster
    51         const char * name;
    52 
    53         // Preemption rate on this cluster
    54         Duration preemption_rate;
    55 };
    56 
    57 extern struct cluster * mainCluster;
    58 extern Duration default_preemption();
    59 
    60 void ?{} (cluster & this, const char * name, Duration preemption_rate);
    61 void ^?{}(cluster & this);
    62 
    63 static inline void ?{} (cluster & this)                           { this{"Anonymous Cluster", default_preemption()}; }
    64 static inline void ?{} (cluster & this, Duration preemption_rate) { this{"Anonymous Cluster", preemption_rate}; }
    65 static inline void ?{} (cluster & this, const char * name)        { this{name, default_preemption()}; }
    66 
    67 //-----------------------------------------------------------------------------
    68 // Processor
    6945enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule };
    7046
     
    9874
    9975        // Cluster from which to get threads
    100         cluster * cltr;
     76        struct cluster * cltr;
    10177
    10278        // Name of the processor
     
    124100        bool pending_preemption;
    125101
     102        // Idle lock
     103
     104        // Link lists fields
     105        struct {
     106                struct processor * next;
     107                struct processor * prev;
     108        } node;
     109
    126110#ifdef __CFA_DEBUG__
    127111        // Last function to enable preemption on this processor
     
    130114};
    131115
    132 void  ?{}(processor & this, const char * name, cluster & cltr);
     116void  ?{}(processor & this, const char * name, struct cluster & cltr);
    133117void ^?{}(processor & this);
    134118
    135119static inline void  ?{}(processor & this)                    { this{ "Anonymous Processor", *mainCluster}; }
    136 static inline void  ?{}(processor & this, cluster & cltr)    { this{ "Anonymous Processor", cltr}; }
     120static inline void  ?{}(processor & this, struct cluster & cltr)    { this{ "Anonymous Processor", cltr}; }
    137121static inline void  ?{}(processor & this, const char * name) { this{name, *mainCluster }; }
     122
     123static inline [processor *&, processor *& ] __get( processor & this ) {
     124        return this.node.[next, prev];
     125}
     126
     127//-----------------------------------------------------------------------------
     128// Cluster
     129struct cluster {
     130        // Ready queue locks
     131        __spinlock_t ready_queue_lock;
     132
     133        // Ready queue for threads
     134        __queue_t(thread_desc) ready_queue;
     135
     136        // Name of the cluster
     137        const char * name;
     138
     139        // Preemption rate on this cluster
     140        Duration preemption_rate;
     141
     142        // List of processors
     143        __spinlock_t proc_list_lock;
     144        __dllist_t(struct processor) procs;
     145        __dllist_t(struct processor) idles;
     146
     147        // Link lists fields
     148        struct {
     149                cluster * next;
     150                cluster * prev;
     151        } node;
     152};
     153extern Duration default_preemption();
     154
     155void ?{} (cluster & this, const char * name, Duration preemption_rate);
     156void ^?{}(cluster & this);
     157
     158static inline void ?{} (cluster & this)                           { this{"Anonymous Cluster", default_preemption()}; }
     159static inline void ?{} (cluster & this, Duration preemption_rate) { this{"Anonymous Cluster", preemption_rate}; }
     160static inline void ?{} (cluster & this, const char * name)        { this{name, default_preemption()}; }
     161
     162static inline [cluster *&, cluster *& ] __get( cluster & this ) {
     163        return this.node.[next, prev];
     164}
    138165
    139166// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.