DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] release/acquire memory barriers and ring
@ 2018-02-13 19:37 Alex Kiselev
  2018-02-13 19:43 ` Alex Kiselev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Kiselev @ 2018-02-13 19:37 UTC (permalink / raw)
  To: dev

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

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

end of thread, other threads:[~2018-02-17 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-13 19:37 [dpdk-dev] release/acquire memory barriers and ring Alex Kiselev
2018-02-13 19:43 ` Alex Kiselev
2018-02-16 17:58 ` Stephen Hemminger
2018-02-17 13:59 ` Burakov, Anatoly

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).