Skip to content

Share fds between threads. #227

@thomasbarrett

Description

@thomasbarrett

Even though tokio-uring is strictly a single-threaded runtime, I have an application that requires being able to share fds between different threads (each with their own instance of tokio-uring). Temporarily, I have been taking the approach of just leaking the tokio_uring::File struct with std::mem::forget to prevent the fd from being closed when it goes out of scope. Ideally, there would be some way to have tokio-uring "forget" a file descriptor. I was thinking that I would just submit a PR to add the IntoRawFd method for tokio_uring::File, but the logic around closing a File looks more complicated than I expected, so I figured that I would post here to see if there is a better way first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions