- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.hfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
r2d8f7b0 rf6660520 40 40 void P (semaphore & this); 41 41 bool V (semaphore & this); 42 bool V (semaphore & this, unsigned count); 42 43 43 44 … … 135 136 // Like head/tail but not seen by the kernel 136 137 volatile uint32_t alloc; 138 volatile uint32_t ready; 137 139 138 140 __spinlock_t lock; … … 144 146 void * ring_ptr; 145 147 size_t ring_sz; 148 149 // Statistics 150 #if !defined(__CFA_NO_STATISTICS__) 151 struct { 152 struct { 153 unsigned long long int val; 154 unsigned long long int cnt; 155 } submit_avg; 156 } stats; 157 #endif 146 158 }; 147 159 … … 164 176 void * ring_ptr; 165 177 size_t ring_sz; 166 }; 178 179 // Statistics 180 #if !defined(__CFA_NO_STATISTICS__) 181 struct { 182 struct { 183 unsigned long long int val; 184 unsigned long long int cnt; 185 } completed_avg; 186 } stats; 187 #endif 188 }; 189 190 #if defined(__CFA_IO_POLLING_USER__) 191 struct __io_poller_fast { 192 struct io_ring * ring; 193 $thread thrd; 194 }; 195 #endif 167 196 168 197 struct io_ring { … … 171 200 uint32_t flags; 172 201 int fd; 173 pthread_t poller; 174 void * stack; 202 semaphore submit; 175 203 volatile bool done; 176 semaphore submit; 204 struct { 205 struct { 206 void * stack; 207 pthread_t kthrd; 208 } slow; 209 #if defined(__CFA_IO_POLLING_USER__) 210 __io_poller_fast fast; 211 __bin_sem_t sem; 212 #endif 213 } poller; 177 214 }; 178 215 #endif … … 213 250 struct io_ring io; 214 251 #endif 252 253 #if !defined(__CFA_NO_STATISTICS__) 254 bool print_stats; 255 #endif 215 256 }; 216 257 extern Duration default_preemption(); … … 227 268 static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE 228 269 static inline struct cluster * active_cluster () { return TL_GET( this_processor )->cltr; } 270 271 #if !defined(__CFA_NO_STATISTICS__) 272 static inline void print_stats_at_exit( cluster & this ) { 273 this.print_stats = true; 274 } 275 #endif 229 276 230 277 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.