Changeset 78da4ab for libcfa/src/concurrency/kernel.hfa
- Timestamp:
- Feb 19, 2021, 1:47:09 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4f762d3
- Parents:
- b44959f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
rb44959f r78da4ab 41 41 42 42 //----------------------------------------------------------------------------- 43 // I/O 44 struct cluster; 45 struct $io_context; 46 struct $io_arbiter; 47 48 struct io_context_params { 49 int num_entries; 50 }; 51 52 void ?{}(io_context_params & this); 53 54 struct io_context { 55 $io_context * ctx; 56 cluster * cltr; 57 }; 58 void ?{}(io_context & this, struct cluster & cl); 59 void ^?{}(io_context & this); 60 61 //----------------------------------------------------------------------------- 43 62 // Processor 44 63 extern struct cluster * mainCluster; … … 78 97 pthread_t kernel_thread; 79 98 99 struct { 100 $io_context * volatile ctx; 101 volatile bool lock; 102 } io; 103 80 104 // Preemption data 81 105 // Node which is added in the discrete event simulaiton … … 116 140 117 141 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 142 162 143 //----------------------------------------------------------------------------- … … 244 225 245 226 struct { 246 io_context * ctxs;247 unsigned cnt;227 $io_arbiter * arbiter; 228 io_context_params params; 248 229 } io; 249 230
Note: See TracChangeset
for help on using the changeset viewer.