compio-rs / compio

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

Try to use polling instead of mio. #66

Closed Berrysoft closed 1 year ago

Berrysoft commented 1 year ago

@George-Miao you've always want this:)

However I've found some problems:

Bonus: Closes #67

George-Miao commented 1 year ago

Cool! Also this should bring more platforms into supported list of compio.

Berrysoft commented 1 year ago

Well there's a big problem here: if one fd added with different keys, it will only show up once. That means we cannot perform multiple read operations on one file.

Berrysoft commented 1 year ago

I have to maintain a queue myself to control the interest.

Berrysoft commented 1 year ago

The performance will be poor if one fd registers a lot operations. We can only pop one operation each time.

I have a question: when a fd is readable, how many read operation could we perform? What if it is writable?

@George-Miao

George-Miao commented 1 year ago

I have a question: when a fd is readable, how many read operation could we perform? What if it is writable?

@George-Miao

It really depends on what type of fd is. I think most of the time it only means at most one read/write operation is non blocking.