GithubHelp home page GithubHelp logo

Comments (7)

Noah-Kennedy avatar Noah-Kennedy commented on July 17, 2024

This is tokio-uring, not rio. If you have a question about this, I'm happy to answer it, but I am not familiar with the implementation details of rio.

from tokio-uring.

kant777 avatar kant777 commented on July 17, 2024

@Noah-Kennedy Sorry, it was a copy/paste error and I haven't got any response from rio so my questions are generally the same and I slightly edited. would be great to know how tokio-uring can help? hope my question is generic enough if not please let me know

from tokio-uring.

Noah-Kennedy avatar Noah-Kennedy commented on July 17, 2024

So, IO functions/methods in tokio-uring will push a SQE to the submission queue. In current releases, these operations are immediately submitted to the kernel, resulting in a syscall. On the master branch, we have implemented batching, and thus we will submit all operations in the queue if it becomes full when constructing an op, and will also submit all operations to the kernel before parking, so system calls tend to be pretty efficiently amortized across operations.

I'd also like to get hooks into tokio at some point to allow us to submit operations periodically when tokio runs it's internal maintenance routine.

from tokio-uring.

kant777 avatar kant777 commented on July 17, 2024

@Noah-Kennedy Got it, so I need to use master, because if it submits a syscall for every operation then that defeats the purpose of io_uring altogether. I am glad to hear that batching is implemented internally but does it submit to kernel only when the buffer is full? what if the buffer isn't full? is there any timer? if not, then why not let users batch their syscalls and provide a function like submit_all?

from tokio-uring.

Noah-Kennedy avatar Noah-Kennedy commented on July 17, 2024

If we attempt to push an operation but the buffer is full, we submit all operations in the buffer to make space and then push.

There is no timer for periodic dispatch. This is better implemented by hooking into the maintenance loop of tokio.

Allowing users to control their own batching is something I'd like to get implemented soon, alongside some newer APIs that give more fine-grained control of operation submission.

from tokio-uring.

kant777 avatar kant777 commented on July 17, 2024

Got it, But again what if the buffer isn't full? it will stay in queue forever? I didn't mean to say timer in isolation but a combination of buffer size and the timer or let the user take care of it all!

from tokio-uring.

Noah-Kennedy avatar Noah-Kennedy commented on July 17, 2024

Currently on master, when there isn't work to do (ie the system parks), it will flush the squeue and submit. This isn't released yet because this isn't exactly ideal; we need to get hooks into tokio to periodically flush the queue every X task polls (I forget how often the tokio maintenance loop runs).

from tokio-uring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.