Changeset c7b2215 for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Nov 29, 2021, 12:50:31 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- a1f3d93
- Parents:
- ddd2ec9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rddd2ec9 rc7b2215 125 125 static void __wake_one(cluster * cltr); 126 126 127 static void idle_sleep(processor * proc, io_future_t & future, char buf[]);127 static void idle_sleep(processor * proc, io_future_t & future, eventfd_t & val); 128 128 static bool mark_idle (__cluster_proc_list & idles, processor & proc); 129 129 static void mark_awake(__cluster_proc_list & idles, processor & proc); … … 131 131 extern void __cfa_io_start( processor * ); 132 132 extern bool __cfa_io_drain( processor * ); 133 extern bool __cfa_io_flush( processor *, bool wait);133 extern bool __cfa_io_flush( processor *, int min_comp ); 134 134 extern void __cfa_io_stop ( processor * ); 135 135 static inline bool __maybe_io_drain( processor * ); … … 169 169 io_future_t future; // used for idle sleep when io_uring is present 170 170 future.self.ptr = 1p; // mark it as already fulfilled so we know if there is a pending request or not 171 char buf[sizeof(uint64_t)];171 eventfd_t idle_val; 172 172 173 173 __cfa_io_start( this ); … … 204 204 205 205 if( !readyThread ) { 206 __cfa_io_flush( this, false);206 __cfa_io_flush( this, 0 ); 207 207 208 208 readyThread = __next_thread_slow( this->cltr ); … … 235 235 } 236 236 237 idle_sleep( this, future, buf);237 idle_sleep( this, future, idle_val ); 238 238 239 239 // We were woken up, remove self from idle … … 256 256 257 257 if(this->io.pending && !this->io.dirty) { 258 __cfa_io_flush( this, false);258 __cfa_io_flush( this, 0 ); 259 259 } 260 260 … … 272 272 273 273 // If we can't find a thread, might as well flush any outstanding I/O 274 if(this->io.pending) { __cfa_io_flush( this, false); }274 if(this->io.pending) { __cfa_io_flush( this, 0 ); } 275 275 276 276 // Spin a little on I/O, just in case … … 367 367 368 368 if(this->io.pending && !this->io.dirty) { 369 __cfa_io_flush( this, false);369 __cfa_io_flush( this, 0 ); 370 370 } 371 371 … … 777 777 } 778 778 779 static void idle_sleep(processor * this, io_future_t & future, char buf[]) {779 static void idle_sleep(processor * this, io_future_t & future, eventfd_t & val) { 780 780 #if !defined(IO_URING_IDLE) || !defined(CFA_HAVE_LINUX_IO_URING_H) 781 781 #if !defined(__CFA_NO_STATISTICS__) … … 819 819 reset(future); 820 820 821 __kernel_read(this, future, buf, this->idle_fd );822 } 823 824 __cfa_io_flush( this, true);821 __kernel_read(this, future, (char *)&val, this->idle_fd ); 822 } 823 824 __cfa_io_flush( this, 1 ); 825 825 #endif 826 826 }
Note: See TracChangeset
for help on using the changeset viewer.