compio-rs / compio

A thread-per-core Rust runtime with IOCP/io_uring/polling.
MIT License
420 stars 37 forks source link

Pop the op later. #85

Closed Berrysoft closed 1 year ago

Berrysoft commented 1 year ago

There could be such case:

Proactor::push      0
Proactor::poll      0
Proactor::pop       0
Proactor::push      0 // Because the previous op is popped.
Proactor::poll      0
Proactor::pop       0
Runtime::poll_task  0 // Boom because the second op replaces the first op.

This PR fixes this problem, making poll_task call pop. Therefore the behavior will be:

Proactor::push      0
Proactor::poll      0
Proactor::push      1 // Because the previous op is *not* popped.
Proactor::poll      1
Runtime::poll_task  0
Proactor::pop       0

This PR also makes RawOp totally hidden because the runtime doesn't need to know it.