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

how to let submit_and_wait to wait for a new entry #28

Closed
Sherlock-Holo opened this issue May 5, 2020 · 5 comments
Closed

how to let submit_and_wait to wait for a new entry #28

Sherlock-Holo opened this issue May 5, 2020 · 5 comments
Labels
question Further information is requested

Comments

@Sherlock-Holo
Copy link

with concurrent IoUring, I create a thread and it will call submit_and_wait(1) to waiting for the entry, when it is waiting, I create another thread and push a new entry into sqe. but the thread one doesn't know a new entry is pushed.

How to let submit_and_wait know a new entry is pushed and return it when it ready? I've tried to call submit after push, it works with Readv and Writev, the submit_and_wait return after read or write complete, but Openat2 doesn't work, the submit_and_wait still blocking even the file is created.

Is there a better way to do this?

@quininer
Copy link
Member

quininer commented May 6, 2020

but Openat2 doesn't work, the submit_and_wait still blocking even the file is created.

I failed to reproduce this problem. can you share your code?

@quininer quininer added the question Further information is requested label May 6, 2020
@Sherlock-Holo
Copy link
Author

Sherlock-Holo commented May 6, 2020

@quininer

open_options.rs: https://fars.ee/0plu/
lib.rs: https://fars.ee/JV4i/
ext.rs: https://fars.ee/Kguw/
Cargo.toml https://fars.ee/xXlP/

the tests::open run won't finish because ring.submit_and_wait(1).unwrap(); never return

other tests work well

my kernel is 5.6.10-arch1-1, it should support Openat2

@Sherlock-Holo
Copy link
Author

Sherlock-Holo commented May 6, 2020

run cargo test with --nocapture, the tests::open will print some log like

    Finished test [unoptimized + debuginfo] target(s) in 0.07s
     Running target/debug/deps/ring_io-100c7598fff98b7a

running 1 test
dir path "/tmp/.tmpLlv2mk"
file path "/tmp/.tmpLlv2mk/test"
start create file
pushed
submited

if submit_and_wait return, it should print log wait done and the test will be finished

@quininer
Copy link
Member

quininer commented May 6, 2020

You forgot to call init_ring in OpenFuture, which caused submit_and_wait not to be called at all.

@Sherlock-Holo
Copy link
Author

oh.... thank you to point my mistake 🤣. after call it, the tests::open works well now, problem solved

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

No branches or pull requests

2 participants