-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
SQ, CQ and Registrar contain NonNull<io_uring> which point to the same value.
Lines 47 to 50 in 045f8d4
| pub struct SubmissionQueue<'ring> { | |
| ring: NonNull<uring_sys::io_uring>, | |
| _marker: PhantomData<&'ring mut IoUring>, | |
| } |
Lines 14 to 17 in 045f8d4
| pub struct CompletionQueue<'ring> { | |
| pub(crate) ring: NonNull<uring_sys::io_uring>, | |
| _marker: PhantomData<&'ring mut IoUring>, | |
| } |
Lines 47 to 50 in 045f8d4
| pub struct Registrar<'ring> { | |
| ring: NonNull<uring_sys::io_uring>, | |
| _marker: PhantomData<&'ring mut IoUring>, | |
| } |
NonNull::as_ref and NonNull::as_mut require borrow check.
But if we split (SQ, CQ) into a producer thread and a consumer thread, both of them can access the same value without synchronization and break the borrow rule.
Metadata
Metadata
Assignees
Labels
No labels