Re: [RFC v2 11/13] rust: sync: Add memory barriers

2024-11-01 Thread Boqun Feng
On Fri, Nov 01, 2024 at 02:55:23PM +0800, David Gow wrote: > On Fri, 1 Nov 2024 at 14:07, Boqun Feng wrote: > > > > Memory barriers are building blocks for concurrent code, hence provide > > a minimal set of them. > > > > The compiler barrier, barrier(), is implemented in inline asm instead of > >

Re: [RFC v2 11/13] rust: sync: Add memory barriers

2024-10-31 Thread David Gow
On Fri, 1 Nov 2024 at 14:07, Boqun Feng wrote: > > Memory barriers are building blocks for concurrent code, hence provide > a minimal set of them. > > The compiler barrier, barrier(), is implemented in inline asm instead of > using core::sync::atomic::compiler_fence() because memory models are > d

[RFC v2 11/13] rust: sync: Add memory barriers

2024-10-31 Thread Boqun Feng
Memory barriers are building blocks for concurrent code, hence provide a minimal set of them. The compiler barrier, barrier(), is implemented in inline asm instead of using core::sync::atomic::compiler_fence() because memory models are different: kernel's atomics are implemented in inline asm ther