Changeset d4da1535 for libcfa/src/concurrency
- Timestamp:
- Mar 29, 2022, 4:41:30 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 4598e03
- Parents:
- edf247b (diff), 6e47b49 (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. - Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
redf247b rd4da1535 635 635 636 636 // We can proceed to the fast path 637 if( !__alloc(ctx, &idx, 1) ) return false; 637 if( !__alloc(ctx, &idx, 1) ) { 638 /* paranoid */ verify( false ); // for now check if this happens, next time just abort the sleep. 639 return false; 640 } 638 641 639 642 // Allocation was successful … … 665 668 666 669 /* paranoid */ verify( sqe->user_data == (uintptr_t)&future ); 667 __submit ( ctx, &idx, 1, true);670 __submit_only( ctx, &idx, 1 ); 668 671 669 672 /* paranoid */ verify( proc == __cfaabi_tls.this_processor ); … … 676 679 iovec iov; 677 680 __atomic_acquire( &proc->io.ctx->cq.lock ); 681 682 __attribute__((used)) volatile bool was_reset = false; 678 683 679 684 with( proc->idle_wctx) { … … 687 692 iov.iov_len = sizeof(eventfd_t); 688 693 __kernel_read(proc, *ftr, iov, evfd ); 694 ftr->result = 0xDEADDEAD; 695 *((eventfd_t *)rdbuf) = 0xDEADDEADDEADDEAD; 696 was_reset = true; 689 697 } 690 698 } 691 699 692 __ioarbiter_flush( *proc->io.ctx ); 693 ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS); 700 if( !__atomic_load_n( &proc->do_terminate, __ATOMIC_SEQ_CST ) ) { 701 __ioarbiter_flush( *proc->io.ctx ); 702 proc->idle_wctx.sleep_time = rdtscl(); 703 ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS); 704 } 694 705 695 706 ready_schedule_lock(); 696 707 __cfa_do_drain( proc->io.ctx, proc->cltr ); 697 708 ready_schedule_unlock(); 709 710 asm volatile ("" :: "m" (was_reset)); 698 711 } 699 712 #endif -
libcfa/src/concurrency/kernel.cfa
redf247b rd4da1535 682 682 this->idle_wctx.sem = 1; 683 683 684 this->idle_wctx.wake_time = rdtscl(); 685 684 686 eventfd_t val; 685 687 val = 1; -
libcfa/src/concurrency/kernel.hfa
redf247b rd4da1535 74 74 // unused if not using io_uring for idle sleep 75 75 io_future_t * ftr; 76 77 volatile unsigned long long wake_time; 78 volatile unsigned long long sleep_time; 76 79 }; 77 80 -
libcfa/src/concurrency/kernel/startup.cfa
redf247b rd4da1535 558 558 559 559 idle_wctx.sem = 0; 560 idle_wctx.wake_time = 0; 560 561 561 562 // I'm assuming these two are reserved for standard input and output
Note: See TracChangeset
for help on using the changeset viewer.