unsafe impl `Send+Sync` for `Submitter`, `SubmissionQueue`, `CompletionQueue`
The IoUring type already has Send + Sync impls.
In tokio-epoll-uring, we use split() and need the Submitter, SubmissionQueue and CompletionQueue to be Send (not sync, though).
This PR adds those unsafe impls, and adds hopefully not too repetitive commentary on why these impls are safe.
Co-authored-by: Conrad Ludgate [email protected] Cherry picked from commit https://github.com/neondatabase/fork--tokio-rs--io-uring/commit/bbc5a0c5f6cde9051037ec2fcc648cbadb7a80b4
You seem to have to use unsafe to get &'static mut or use scope thread to make sense. I would recommend submission_shared and completion_shared.
see https://github.com/tokio-rs/io-uring/pull/100/files#diff-3a884378bde161d43e3099c530c5090847e826cb4501d4f7a803144e6bde14d3
Sorry, I'm not following. Who's talking about &'static mut ?
I would recommend submission_shared and completion_shared.
The unsafe impls proposed in this PR allow movement of Submitter, SubmissionQueue, and CompletionQueue, to different threads in consuming code, without any unsafe.
I consider that strictly better than the unsafe fn submission_shared() and unsafe fn completion_shared().
This would be useful in my project as well