Changeset 37ba662
- Timestamp:
- Jun 16, 2020, 3:32:00 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 04b5cef
- Parents:
- 2073d207
- Location:
- libcfa/src/concurrency
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
r2073d207 r37ba662 182 182 //SKULLDUGGERY errno is not save in the thread data structure because returnToKernel appears to be the only function to require saving and restoring it 183 183 184 // coroutine body used to store context185 struct $coroutine self_cor;186 187 // current active context188 struct $coroutine * curr_cor;189 190 // monitor body used for mutual exclusion191 struct $monitor self_mon;192 193 // pointer to monitor with sufficient lifetime for current monitors194 struct $monitor * self_mon_p;195 196 184 // pointer to the cluster on which the thread is running 197 185 struct cluster * curr_cluster; 198 199 // monitors currently held by this thread200 struct __monitor_group_t monitors;201 186 202 187 // Link lists fields 203 188 // instrusive link field for threads 204 189 struct __thread_desc_link link; 190 191 // coroutine body used to store context 192 struct $coroutine self_cor; 193 194 // current active context 195 struct $coroutine * curr_cor; 196 197 // monitor body used for mutual exclusion 198 struct $monitor self_mon; 199 200 // pointer to monitor with sufficient lifetime for current monitors 201 struct $monitor * self_mon_p; 202 203 // monitors currently held by this thread 204 struct __monitor_group_t monitors; 205 205 206 206 struct { -
libcfa/src/concurrency/kernel.hfa
r2073d207 r37ba662 61 61 62 62 // Wrapper around kernel threads 63 struct processor { 63 struct __attribute__((aligned(128))) processor { 64 // Main state 64 65 inline __processor_id_t; 65 66 66 // Main state 67 // Cluster from which to get threads 68 struct cluster * cltr; 69 70 // Set to true to notify the processor should terminate 71 volatile bool do_terminate; 72 67 73 // Coroutine ctx who does keeps the state of the processor 68 74 struct processorCtx_t runner; 69 70 // Cluster from which to get threads71 struct cluster * cltr;72 75 73 76 // Name of the processor … … 90 93 // Idle lock (kernel semaphore) 91 94 __bin_sem_t idle; 92 93 // Termination94 // Set to true to notify the processor should terminate95 volatile bool do_terminate;96 95 97 96 // Termination synchronisation (user semaphore) … … 153 152 //TODO adjust cache size to ARCHITECTURE 154 153 // Structure holding the relaxed ready queue 155 struct __ attribute__((aligned(128))) __ready_queue_t {154 struct __ready_queue_t { 156 155 // Data tracking how many/which lanes are used 157 156 // Aligned to 128 for cache locality … … 162 161 // used can change on each push/pop but this data 163 162 // only changes on shrink/grow 164 struct __attribute__((aligned(64))){163 struct { 165 164 // Arary of lanes 166 165 __intrusive_lane_t * volatile data; … … 176 175 //----------------------------------------------------------------------------- 177 176 // Cluster 178 struct cluster {177 struct __attribute__((aligned(128))) cluster { 179 178 // Ready queue for threads 180 179 __ready_queue_t ready_queue; -
libcfa/src/concurrency/kernel_private.hfa
r2073d207 r37ba662 26 26 // Scheduler 27 27 28 struct __attribute__((aligned( 64))) __scheduler_lock_id_t;28 struct __attribute__((aligned(128))) __scheduler_lock_id_t; 29 29 30 30 extern "C" { … … 111 111 // Cells use by the reader writer lock 112 112 // while not generic it only relies on a opaque pointer 113 struct __attribute__((aligned( 64))) __scheduler_lock_id_t {113 struct __attribute__((aligned(128))) __scheduler_lock_id_t { 114 114 __processor_id_t * volatile handle; 115 115 volatile bool lock; -
libcfa/src/concurrency/ready_queue.cfa
r2073d207 r37ba662 120 120 // Return new spot. 121 121 /*paranoid*/ verify(n < ready); 122 /*paranoid*/ verify(__alignof__(data[n]) == cache_line_size);122 /*paranoid*/ verify(__alignof__(data[n]) == (2 * cache_line_size)); 123 123 /*paranoid*/ verify((((uintptr_t)&data[n]) % cache_line_size) == 0); 124 124 return n; -
libcfa/src/concurrency/stats.hfa
r2073d207 r37ba662 66 66 #endif 67 67 68 struct __ stats_t {68 struct __attribute__((aligned(128))) __stats_t { 69 69 __stats_readQ_t ready; 70 70 #if defined(HAVE_LINUX_IO_URING_H)
Note: See TracChangeset
for help on using the changeset viewer.