Changeset 4e74466
- Timestamp:
- May 5, 2020, 12:12:47 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 71c8b7e
- Parents:
- b6f2b213
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
rb6f2b213 r4e74466 522 522 __cfadbg_print_safe(io_core, "Kernel I/O : Fast poller for ring %p ready\n", &this.ring); 523 523 524 int reset = 0; 525 524 526 // Then loop until we need to start 525 527 while(!__atomic_load_n(&this.ring->done, __ATOMIC_SEQ_CST)) { … … 527 529 this.waiting = false; 528 530 int count = __drain_io( *this.ring, 0p, 0, false ); 531 reset += count > 0 ? 1 : 0; 529 532 530 533 // Update statistics … … 535 538 536 539 this.waiting = true; 537 if( 0 > count) {540 if(reset < 5) { 538 541 // If we got something, just yield and check again 539 542 yield(); … … 544 547 post( this.ring->poller.sem ); 545 548 park( __cfaabi_dbg_ctx ); 549 reset = 0; 546 550 } 547 551 }
Note: See TracChangeset
for help on using the changeset viewer.