DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alex Kiselev <kiselev99@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] release/acquire memory barriers and ring
Date: Tue, 13 Feb 2018 22:37:37 +0300	[thread overview]
Message-ID: <CAMKNYbw7=b69eCM17p8SperLRD86wtKw3iLj1FtG8gL7bUakNg@mail.gmail.com> (raw)

Hi.

I've been wondering should I use a release/acquire memory barrier pair
in order to be sure that the other thread will see the fully/corrected
initialized object
passed to it via a dpdk ring or ring itself is a kind of barrier?

Let's say I have a pseudo code:

Thread1:
obj = alloc();
...
obj initialization
...

??? fence(memory_order_release); ???
rte_ring_sp_enqueue(ring, obj)


Thread2:
??? fence(memory_order_acquire); ???
rte_ring_sc_dequeue(ring, obj)

Should I use fences in that code?

Thanks.

--
Alex

             reply	other threads:[~2018-02-13 19:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 19:37 Alex Kiselev [this message]
2018-02-13 19:43 ` Alex Kiselev
2018-02-16 17:58 ` Stephen Hemminger
2018-02-17 13:59 ` Burakov, Anatoly

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='CAMKNYbw7=b69eCM17p8SperLRD86wtKw3iLj1FtG8gL7bUakNg@mail.gmail.com' \
    --to=kiselev99@gmail.com \
    --cc=dev@dpdk.org \
    /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).