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

Should File be Send? #229

Closed
thomasbarrett opened this issue Feb 6, 2023 · 3 comments
Closed

Should File be Send? #229

thomasbarrett opened this issue Feb 6, 2023 · 3 comments

Comments

@thomasbarrett
Copy link

I am opening this thread to raise the topic of whether or not the tokio_uring::File type can be made Send. Once a Fd is opened from one thread, there is nothing prevent users from re-using that same Fd on another uring on another thread. Making File !Send is currently an entirely artificial limitation of tokio-uring.

@FrankReh
Copy link
Collaborator

FrankReh commented Feb 7, 2023

I wish you wouldn't use the term artificial. It conveys that the authors didn't give it thought. I think thought was put into it and the decision so far has been to use Rc and RefCell instead of Arc and Mutex to keep things fast and keep the logic around their guards short, with no waiting for locks. I'm not against providing extra functions under the unsafe banner.

@Noah-Kennedy
Copy link
Contributor

I think it should eventually be made Send, as a part of supporting multi_thread.

@Noah-Kennedy
Copy link
Contributor

Closing in favor of #258.

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

3 participants