Changeset 8d66610 for libcfa/src/concurrency/kernel.hfa
- Timestamp:
- May 21, 2021, 4:48:10 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- f1bce515
- Parents:
- 5407cdc (diff), 7404cdc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.hfa (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
r5407cdc r8d66610 49 49 50 50 // Processor id, required for scheduling threads 51 struct __processor_id_t { 52 unsigned id:24; 53 54 #if !defined(__CFA_NO_STATISTICS__) 55 struct __stats_t * stats; 56 #endif 57 }; 51 58 52 59 53 coroutine processorCtx_t { … … 63 57 // Wrapper around kernel threads 64 58 struct __attribute__((aligned(128))) processor { 65 // Main state66 inline __processor_id_t;67 68 59 // Cluster from which to get threads 69 60 struct cluster * cltr; … … 90 81 pthread_t kernel_thread; 91 82 83 // Unique id for the processor (not per cluster) 84 unsigned unique_id; 85 92 86 struct { 93 87 $io_context * ctx; … … 113 107 114 108 // Link lists fields 115 DLISTED_MGD_IMPL_IN(processor)109 inline dlink(processor); 116 110 117 111 // special init fields … … 123 117 } init; 124 118 119 struct KernelThreadData * local_data; 120 125 121 #if !defined(__CFA_NO_STATISTICS__) 126 122 int print_stats; … … 133 129 #endif 134 130 }; 131 P9_EMBEDDED( processor, dlink(processor) ) 135 132 136 133 void ?{}(processor & this, const char name[], struct cluster & cltr); … … 140 137 static inline void ?{}(processor & this, struct cluster & cltr) { this{ "Anonymous Processor", cltr}; } 141 138 static inline void ?{}(processor & this, const char name[]) { this{name, *mainCluster}; } 142 143 DLISTED_MGD_IMPL_OUT(processor)144 139 145 140 //----------------------------------------------------------------------------- … … 152 147 153 148 // Aligned timestamps which are used by the relaxed ready queue 154 struct __attribute__((aligned(128))) __timestamp_t; 155 void ?{}(__timestamp_t & this); 156 void ^?{}(__timestamp_t & this); 149 struct __attribute__((aligned(128))) __timestamp_t { 150 volatile unsigned long long tv; 151 }; 152 153 static inline void ?{}(__timestamp_t & this) { this.tv = 0; } 154 static inline void ^?{}(__timestamp_t & this) {} 157 155 158 156 //TODO adjust cache size to ARCHITECTURE … … 177 175 void ?{}(__ready_queue_t & this); 178 176 void ^?{}(__ready_queue_t & this); 177 #if !defined(__CFA_NO_STATISTICS__) 178 unsigned cnt(const __ready_queue_t & this, unsigned idx); 179 #endif 179 180 180 181 // Idle Sleep … … 190 191 191 192 // List of idle processors 192 dlist(processor , processor) idles;193 dlist(processor) idles; 193 194 194 195 // List of active processors 195 dlist(processor , processor) actives;196 dlist(processor) actives; 196 197 }; 197 198
Note:
See TracChangeset
for help on using the changeset viewer.