- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
rda3963a rdddb3dd0 28 28 } 29 29 30 //-----------------------------------------------------------------------------31 // Underlying Locks32 30 #ifdef __CFA_WITH_VERIFY__ 33 31 extern bool __cfaabi_dbg_in_kernel(); 34 32 #endif 35 33 36 struct __bin_sem_t { 37 pthread_mutex_t lock; 38 pthread_cond_t cond; 39 int val; 40 }; 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); 41 45 42 46 //----------------------------------------------------------------------------- … … 78 82 pthread_t kernel_thread; 79 83 84 struct { 85 $io_context * ctx; 86 bool pending; 87 bool dirty; 88 } io; 89 80 90 // Preemption data 81 91 // Node which is added in the discrete event simulaiton … … 86 96 87 97 // Idle lock (kernel semaphore) 88 __bin_sem_t idle;98 int idle; 89 99 90 100 // Termination synchronisation (user semaphore) … … 116 126 117 127 DLISTED_MGD_IMPL_OUT(processor) 118 119 //-----------------------------------------------------------------------------120 // I/O121 struct __io_data;122 123 // IO poller user-thread124 // Not using the "thread" keyword because we want to control125 // more carefully when to start/stop it126 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);161 128 162 129 //----------------------------------------------------------------------------- … … 244 211 245 212 struct { 246 io_context * ctxs;247 unsigned cnt;213 $io_arbiter * arbiter; 214 io_context_params params; 248 215 } io; 249 216
Note:
See TracChangeset
for help on using the changeset viewer.