Open problame opened 4 months ago
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
.
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()
.
The
IoUring
type already hasSend
+Sync
impls.In tokio-epoll-uring, we use
split()
and need theSubmitter
,SubmissionQueue
andCompletionQueue
to beSend
(not sync, though).This PR adds those
unsafe impl
s, and adds hopefully not too repetitive commentary on why these impls are safe.Co-authored-by: Conrad Ludgate conrad@neon.tech Cherry picked from commit https://github.com/neondatabase/fork--tokio-rs--io-uring/commit/bbc5a0c5f6cde9051037ec2fcc648cbadb7a80b4