Changes in libcfa/src/concurrency/invoke.h [d72c074:ae7be7a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
rd72c074 rae7be7a 48 48 extern __attribute__((aligned(128))) thread_local struct KernelThreadData { 49 49 struct $thread * volatile this_thread; 50 struct processor * volatile this_processor; 51 struct __stats_t * volatile this_stats; 50 struct processor * volatile this_processor; 52 51 53 52 struct { … … 57 56 } preemption_state; 58 57 59 __uint128_t rand_seed;58 uint32_t rand_seed; 60 59 } kernelTLS __attribute__ ((tls_model ( "initial-exec" ))); 61 60 } … … 93 92 }; 94 93 95 enum __Coroutine_State { Halted, Start, Primed, Blocked, Ready, Active};94 enum coroutine_state { Halted, Start, Primed, Blocked, Ready, Active, Rerun }; 96 95 enum __Preemption_Reason { __NO_PREEMPTION, __ALARM_PREEMPTION, __POLL_PREEMPTION, __MANUAL_PREEMPTION }; 97 96 … … 107 106 108 107 // current execution status for coroutine 109 enum __Coroutine_State state;108 enum coroutine_state state; 110 109 111 110 // first coroutine to resume this one … … 162 161 }; 163 162 164 // Link lists fields165 // instrusive link field for threads166 struct __thread_desc_link {167 struct $thread * next;168 struct $thread * prev;169 volatile unsigned long long ts;170 int preferred;171 };172 173 163 struct $thread { 174 164 // Core threading fields … … 177 167 178 168 // current execution status for coroutine 179 volatile int ticket; 180 enum __Coroutine_State state:8; 181 enum __Preemption_Reason preempted:8; 169 volatile int state; 170 enum __Preemption_Reason preempted; 182 171 183 172 //SKULLDUGGERY errno is not save in the thread data structure because returnToKernel appears to be the only function to require saving and restoring it 173 174 // coroutine body used to store context 175 struct $coroutine self_cor; 176 177 // current active context 178 struct $coroutine * curr_cor; 179 180 // monitor body used for mutual exclusion 181 struct $monitor self_mon; 182 183 // pointer to monitor with sufficient lifetime for current monitors 184 struct $monitor * self_mon_p; 184 185 185 186 // pointer to the cluster on which the thread is running 186 187 struct cluster * curr_cluster; 187 188 189 // monitors currently held by this thread 190 struct __monitor_group_t monitors; 191 188 192 // Link lists fields 189 193 // instrusive link field for threads 190 struct __thread_desc_link link; 191 192 // coroutine body used to store context 193 struct $coroutine self_cor; 194 195 // current active context 196 struct $coroutine * curr_cor; 197 198 // monitor body used for mutual exclusion 199 struct $monitor self_mon; 200 201 // pointer to monitor with sufficient lifetime for current monitors 202 struct $monitor * self_mon_p; 203 204 // monitors currently held by this thread 205 struct __monitor_group_t monitors; 194 struct $thread * next; 206 195 207 196 struct { … … 213 202 // previous function to park/unpark the thread 214 203 const char * park_caller; 215 int park_result; 216 enum __Coroutine_State park_state; 204 enum coroutine_state park_result; 217 205 bool park_stale; 218 206 const char * unpark_caller; 219 int unpark_result; 220 enum __Coroutine_State unpark_state; 207 enum coroutine_state unpark_result; 221 208 bool unpark_stale; 222 209 #endif … … 231 218 #ifdef __cforall 232 219 extern "Cforall" { 233 234 220 static inline $thread *& get_next( $thread & this ) __attribute__((const)) { 235 return this. link.next;221 return this.next; 236 222 } 237 223
Note:
See TracChangeset
for help on using the changeset viewer.