ysono / pancake

7 stars 1 forks source link

async #21

Open btc opened 3 years ago

btc commented 3 years ago

interesting to read in the section "when not to use tokio"

"when reading a lot of files"

https://tokio.rs/tokio/tutorial

ysono commented 3 years ago

This is an interesting point. I didn't know that about lack of async file APIs. I don't intend to work at an abstraction below files. (Eg sqlite seems to manage one big file and prob does some magic to optimize page caching: link. Also there is epoll but I'm not sure how to use it.)

The file IO activities are:

each read request:

each write request:

the flushing job:

the compaction job:

So it seems we want compaction to be synchronous, blocking any read request. But I believe other operations can be concurrent.

ysono commented 3 years ago

Right now, we're cloneing a lot. This will likely be naturally addressed as part of introducing concurrency.