Changes in src/libcfa/concurrency/kernel [de94a60:0f56058]
- File:
-
- 1 edited
-
src/libcfa/concurrency/kernel (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel
rde94a60 r0f56058 40 40 41 41 //----------------------------------------------------------------------------- 42 // Cluster 43 struct cluster { 44 // Ready queue locks 45 __spinlock_t ready_queue_lock; 46 47 // Ready queue for threads 48 __queue_t(thread_desc) ready_queue; 49 50 // Preemption rate on this cluster 51 Duration preemption_rate; 52 }; 53 54 extern Duration default_preemption(); 55 56 void ?{} (cluster & this); 57 void ^?{}(cluster & this); 58 59 //----------------------------------------------------------------------------- 42 60 // Processor 43 extern struct cluster * mainCluster;44 45 61 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule }; 46 62 … … 74 90 75 91 // Cluster from which to get threads 76 struct cluster * cltr; 77 78 // Name of the processor 79 const char * name; 92 cluster * cltr; 80 93 81 94 // Handle to pthreads … … 100 113 bool pending_preemption; 101 114 102 // Idle lock103 104 // Link lists fields105 struct {106 struct processor * next;107 struct processor * prev;108 } node;109 110 115 #ifdef __CFA_DEBUG__ 111 116 // Last function to enable preemption on this processor … … 114 119 }; 115 120 116 void ?{}(processor & this, const char * name, struct cluster & cltr); 121 void ?{}(processor & this); 122 void ?{}(processor & this, cluster * cltr); 117 123 void ^?{}(processor & this); 118 119 static inline void ?{}(processor & this) { this{ "Anonymous Processor", *mainCluster}; }120 static inline void ?{}(processor & this, struct cluster & cltr) { this{ "Anonymous Processor", cltr}; }121 static inline void ?{}(processor & this, const char * name) { this{name, *mainCluster }; }122 123 static inline [processor *&, processor *& ] __get( processor & this ) {124 return this.node.[next, prev];125 }126 127 //-----------------------------------------------------------------------------128 // Cluster129 struct cluster {130 // Ready queue locks131 __spinlock_t ready_queue_lock;132 133 // Ready queue for threads134 __queue_t(thread_desc) ready_queue;135 136 // Name of the cluster137 const char * name;138 139 // Preemption rate on this cluster140 Duration preemption_rate;141 142 // List of processors143 __spinlock_t proc_list_lock;144 __dllist_t(struct processor) procs;145 __dllist_t(struct processor) idles;146 147 // Link lists fields148 struct {149 cluster * next;150 cluster * prev;151 } node;152 };153 extern Duration default_preemption();154 155 void ?{} (cluster & this, const char * name, Duration preemption_rate);156 void ^?{}(cluster & this);157 158 static inline void ?{} (cluster & this) { this{"Anonymous Cluster", default_preemption()}; }159 static inline void ?{} (cluster & this, Duration preemption_rate) { this{"Anonymous Cluster", preemption_rate}; }160 static inline void ?{} (cluster & this, const char * name) { this{name, default_preemption()}; }161 162 static inline [cluster *&, cluster *& ] __get( cluster & this ) {163 return this.node.[next, prev];164 }165 124 166 125 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.