Changeset b21c77a for src/libcfa/concurrency/kernel
- Timestamp:
- Jun 29, 2018, 4:14:15 PM (7 years ago)
- Branches:
- new-env
- Children:
- 184557e
- Parents:
- 97397a26 (diff), 28f3a19 (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
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel
r97397a26 rb21c77a 23 23 extern "C" { 24 24 #include <pthread.h> 25 #include <semaphore.h> 25 26 } 26 27 … … 43 44 extern struct cluster * mainCluster; 44 45 45 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule }; 46 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule, Callback }; 47 48 typedef void (*__finish_callback_fptr_t)(void); 46 49 47 50 //TODO use union, many of these fields are mutually exclusive (i.e. MULTI vs NOMULTI) 48 51 struct FinishAction { 49 52 FinishOpCode action_code; 53 /* 54 // Union of possible actions 55 union { 56 // Option 1 : locks and threads 57 struct { 58 // 1 thread or N thread 59 union { 60 thread_desc * thrd; 61 struct { 62 thread_desc ** thrds; 63 unsigned short thrd_count; 64 }; 65 }; 66 // 1 lock or N lock 67 union { 68 __spinlock_t * lock; 69 struct { 70 __spinlock_t ** locks; 71 unsigned short lock_count; 72 }; 73 }; 74 }; 75 // Option 2 : action pointer 76 __finish_callback_fptr_t callback; 77 }; 78 /*/ 50 79 thread_desc * thrd; 80 thread_desc ** thrds; 81 unsigned short thrd_count; 51 82 __spinlock_t * lock; 52 83 __spinlock_t ** locks; 53 84 unsigned short lock_count; 54 thread_desc ** thrds;55 unsigned short thrd_count;85 __finish_callback_fptr_t callback; 86 //*/ 56 87 }; 57 88 static inline void ?{}(FinishAction & this) { … … 82 113 pthread_t kernel_thread; 83 114 115 // RunThread data 116 // Action to do after a thread is ran 117 struct FinishAction finish; 118 119 // Preemption data 120 // Node which is added in the discrete event simulaiton 121 struct alarm_node_t * preemption_alarm; 122 123 // If true, a preemption was triggered in an unsafe region, the processor must preempt as soon as possible 124 bool pending_preemption; 125 126 // Idle lock 127 __bin_sem_t idleLock; 128 84 129 // Termination 85 130 // Set to true to notify the processor should terminate … … 89 134 semaphore terminated; 90 135 91 // RunThread data92 // Action to do after a thread is ran93 struct FinishAction finish;94 95 // Preemption data96 // Node which is added in the discrete event simulaiton97 struct alarm_node_t * preemption_alarm;98 99 // If true, a preemption was triggered in an unsafe region, the processor must preempt as soon as possible100 bool pending_preemption;101 102 // Idle lock103 104 136 // Link lists fields 105 struct {137 struct __dbg_node_proc { 106 138 struct processor * next; 107 139 struct processor * prev; … … 150 182 151 183 // Link lists fields 152 struct {184 struct __dbg_node_cltr { 153 185 cluster * next; 154 186 cluster * prev;
Note:
See TracChangeset
for help on using the changeset viewer.