compio-rs / compio

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

submit might require flushing CQEs #11

Closed redbaron closed 1 year ago

redbaron commented 1 year ago

If CQ is full, no more submissions can happen (io_uring_enter returns EBUSY) until CQE are processed to make room in CQ. Currently it doesn't seem to be handled.

Berrysoft commented 1 year ago

You're right, but that roughly means you are joining more than 1024 tasks:)

Anyway, it's a problem need to be solved. Both SQ and CQ should be handled. A simple solution seems to be storing them myself and loop to submit and wait them... Do you have some suggestions?

Berrysoft commented 1 year ago

I've noticed that tokio-uring also choose to submit the opcodes when the squeue is full, but that will make the operation started before the corresponding future polled. Is that OK?

redbaron commented 1 year ago

You're right, but that roughly means you are joining more than 1024 tasks:)

Multi opcodes can generate multiple CQEs from one SQE

Berrysoft commented 1 year ago

Fortunately we don't support multi opcodes until now...

I'll discover a proper solution, but maybe not zero cost.