kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Navin P <navinp0304@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: memory order seq cst for atomics
Date: Fri, 2 Apr 2021 17:09:53 +0200	[thread overview]
Message-ID: <YGczwTMv/RG6i4M7@kroah.com> (raw)
In-Reply-To: <CALO2TqKd7QYSM55a78M2v0xjJfw+DVdo0RtB5JH_nfD3HzUMoQ@mail.gmail.com>

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

      reply	other threads:[~2021-04-02 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 14:45 memory order seq cst for atomics Navin P
2021-04-02 15:09 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YGczwTMv/RG6i4M7@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=navinp0304@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).