- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.hfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
r7768b8d rd4e68a6 106 106 // Cluster from which to get threads 107 107 struct cluster * cltr; 108 unsigned int id;109 108 110 109 // Name of the processor … … 158 157 } 159 158 160 161 //-----------------------------------------------------------------------------162 // Cluster Tools163 struct __processor_id;164 165 // Reader-Writer lock protecting the ready-queue166 struct __clusterRWLock_t {167 // total cachelines allocated168 unsigned int max;169 170 // cachelines currently in use171 volatile unsigned int alloc;172 173 // cachelines ready to itereate over174 // (!= to alloc when thread is in second half of doregister)175 volatile unsigned int ready;176 177 // writer lock178 volatile bool lock;179 180 // data pointer181 __processor_id * data;182 };183 184 void ?{}(__clusterRWLock_t & this);185 void ^?{}(__clusterRWLock_t & this);186 187 // Underlying sub quues of the ready queue188 struct __attribute__((aligned(128))) __intrusive_ready_queue_t {189 // spin lock protecting the queue190 volatile bool lock;191 192 // anchor for the head and the tail of the queue193 struct __sentinel_t {194 struct thread_desc * next;195 struct thread_desc * prev;196 unsigned long long ts;197 } before, after;198 199 // Optional statistic counters200 #ifndef __CFA_NO_SCHED_STATS__201 struct __attribute__((aligned(64))) {202 // difference between number of push and pops203 ssize_t diff;204 205 // total number of pushes and pops206 size_t push;207 size_t pop ;208 } stat;209 #endif210 };211 212 void ?{}(__intrusive_ready_queue_t & this);213 void ^?{}(__intrusive_ready_queue_t & this);214 215 159 //----------------------------------------------------------------------------- 216 160 // Cluster 217 161 struct cluster { 218 162 // Ready queue locks 219 __ clusterRWLock_t ready_lock;163 __spinlock_t ready_queue_lock; 220 164 221 165 // Ready queue for threads 222 __ intrusive_ready_queue_tready_queue;166 __queue_t(thread_desc) ready_queue; 223 167 224 168 // Name of the cluster … … 230 174 // List of processors 231 175 __spinlock_t proc_list_lock; 176 __dllist_t(struct processor) procs; 232 177 __dllist_t(struct processor) idles; 178 unsigned int nprocessors; 233 179 234 180 // List of threads
Note:
See TracChangeset
for help on using the changeset viewer.