Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestions for designing event loop around rio interface #47

Open
jonathanstrong opened this issue May 6, 2021 · 0 comments
Open

suggestions for designing event loop around rio interface #47

jonathanstrong opened this issue May 6, 2021 · 0 comments

Comments

@jonathanstrong
Copy link

hello,

I was wondering if you could offer advice about how to store pending Completion instances while you are waiting for them to be completed, potentially doing other work in the meantime and submitting additional tasks to the queue.

the two issues I ran into while attempting a demo event loop design around Rio were:

  1. no way to storeCompletion instances returned by my ring, as taking an immutable reference into a collection would prevent the ability to add additional items to it, and
  2. no way to check if a Completion is done without blocking (not sure if this is avoidable, I am not a io-uring expert (yet))

I posted some code here, which is where I stopped, unable to figure out how I would go further: https://gist.github.com/jonathanstrong/0d8aaef2fbbb62d2ddcd291f62a03114

my goal is for a thread pool worker to be receiving io jobs over a channel, submitting work to the ring, potentially for several unrelated jobs at once, then processing the results from the ring as they become available, and sending back info/data about the outcome of the work to the thread that sent the job upon that result becoming available.

another, more big picture way of saying this is, how do I store the context (buffer/file) of a Rio submission, other than a named stack variable as in the examples?

thanks for any help you can provide!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant