All of lore.kernel.org
 help / color / mirror / Atom feed
* memory order seq cst for atomics
@ 2021-04-02 14:45 Navin P
  2021-04-02 15:09 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Navin P @ 2021-04-02 14:45 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 156 bytes --]

Hi,
  C11 and c++11  have memory order like memory_order_seq_cst .What is the
equivalent in Linux kernel ?
atomic64_inc(&var) ;
__SMP_mb();

Regards,
Navin

[-- Attachment #1.2: Type: text/html, Size: 343 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: memory order seq cst for atomics
  2021-04-02 14:45 memory order seq cst for atomics Navin P
@ 2021-04-02 15:09 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-04-02 15:09 UTC (permalink / raw)
  To: Navin P; +Cc: kernelnewbies

On Fri, Apr 02, 2021 at 08:15:12PM +0530, Navin P wrote:
> Hi,
>   C11 and c++11  have memory order like memory_order_seq_cst .What is the
> equivalent in Linux kernel ?
> atomic64_inc(&var) ;
> __SMP_mb();

Please read Documentation/memory-barriers.txt in the kernel source tree.
It should answer all of your questions regarding this.

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-02 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 14:45 memory order seq cst for atomics Navin P
2021-04-02 15:09 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.