- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
rdddb3dd0 rda3963a 28 28 } 29 29 30 //----------------------------------------------------------------------------- 31 // Underlying Locks 30 32 #ifdef __CFA_WITH_VERIFY__ 31 33 extern bool __cfaabi_dbg_in_kernel(); 32 34 #endif 33 35 34 //----------------------------------------------------------------------------- 35 // I/O 36 struct cluster; 37 struct $io_context; 38 struct $io_arbiter; 39 40 struct io_context_params { 41 int num_entries; 42 }; 43 44 void ?{}(io_context_params & this); 36 struct __bin_sem_t { 37 pthread_mutex_t lock; 38 pthread_cond_t cond; 39 int val; 40 }; 45 41 46 42 //----------------------------------------------------------------------------- … … 82 78 pthread_t kernel_thread; 83 79 84 struct {85 $io_context * ctx;86 bool pending;87 bool dirty;88 } io;89 90 80 // Preemption data 91 81 // Node which is added in the discrete event simulaiton … … 96 86 97 87 // Idle lock (kernel semaphore) 98 int idle;88 __bin_sem_t idle; 99 89 100 90 // Termination synchronisation (user semaphore) … … 126 116 127 117 DLISTED_MGD_IMPL_OUT(processor) 118 119 //----------------------------------------------------------------------------- 120 // I/O 121 struct __io_data; 122 123 // IO poller user-thread 124 // Not using the "thread" keyword because we want to control 125 // more carefully when to start/stop it 126 struct $io_ctx_thread { 127 struct __io_data * ring; 128 single_sem sem; 129 volatile bool done; 130 $thread self; 131 }; 132 133 134 struct io_context { 135 $io_ctx_thread thrd; 136 }; 137 138 struct io_context_params { 139 int num_entries; 140 int num_ready; 141 int submit_aff; 142 bool eager_submits:1; 143 bool poller_submits:1; 144 bool poll_submit:1; 145 bool poll_complete:1; 146 }; 147 148 void ?{}(io_context_params & this); 149 150 void ?{}(io_context & this, struct cluster & cl); 151 void ?{}(io_context & this, struct cluster & cl, const io_context_params & params); 152 void ^?{}(io_context & this); 153 154 struct io_cancellation { 155 __u64 target; 156 }; 157 158 static inline void ?{}(io_cancellation & this) { this.target = -1u; } 159 static inline void ^?{}(io_cancellation &) {} 160 bool cancel(io_cancellation & this); 128 161 129 162 //----------------------------------------------------------------------------- … … 211 244 212 245 struct { 213 $io_arbiter * arbiter;214 io_context_params params;246 io_context * ctxs; 247 unsigned cnt; 215 248 } io; 216 249
Note:
See TracChangeset
for help on using the changeset viewer.