From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by dpdk.org (Postfix) with ESMTP id DC1AC1B2C7 for ; Tue, 13 Feb 2018 20:37:38 +0100 (CET) Received: by mail-io0-f176.google.com with SMTP id f89so22524385ioj.4 for ; Tue, 13 Feb 2018 11:37:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=bJFHeCMtzZfMcShPnrMn4LUze9iw8Im8uH1H+/uF8Bo=; b=Syg3bAuAAge3kd9ImbJoFsE6AVpfn4Dqfv0a8b1SY+ICK//38bWyx0i8WrXyr6JZ0T RWTuQiqbJbk+6UJXLx5QrDVJ2Kzlh74yPwsSNdLhExtr4TwZRhPUddAuzKceg+ybCdgP StCwXZNKGmq+mXqzI7lE4Wt4KcmJpvu+Zmu+VFCfB+4r7yu16SrKyjUVjbuvQEaZkhK1 aWxbRzwkt6z3xCZV9+E0oCxNzfYnqBubvnPemt7cNcs/VZnM6gAxTJyez25R5ILAafKB oUZUMerFcQZWrTWujddGMnIjL/eNrKLRaBUybnHxHzR3tla1evHu/Ohtonk3InTyhmmN nSDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bJFHeCMtzZfMcShPnrMn4LUze9iw8Im8uH1H+/uF8Bo=; b=IPpO5kEpCGo+KP9yB1yadRXEesHLYSwPAZmyvoqSK5bba3HYomt6IMPbPK1pWHAQ3N EqED7n26sopAgiOHekOUPyUetfjYo9hHYi85YDIv7airwOsyJKeTpDOoElZ+ael9470G tPpN/gvjLhsaZ9x1v6uUujGP/cUH2r1p1/7eEKoa0YGAihfzfP8As2c4LbBTQKtcu1d6 1V7y2gfr/MDX8O3OtVQy+pPoT/krRP5hMPtL13ZbkYHk1/9t49cKc+jBDnXT2ZAJhdWi KYy6Xm4iArHNS9R1kYnJsZu5N/M2a6ibLCAC5d59TXJ5p/wczgr5r77Sjr7Ghzfqgox0 HosQ== X-Gm-Message-State: APf1xPBkUZhjruHRwNkzljZLbMkBkfEC4rk3J91cGQFCsStkM795Dx0y CQD0APCFUHLJr7yelyWZUHnkQhu97r4SGreRP5Hx0w== X-Google-Smtp-Source: AH8x226hDoSK7PodW7cXkO7u7MAJeDOTvp93OhrzMzu8OqAMGERc28pvj2KbCSvBgW3c6bxed9JehhRRKrRnW8oe0fI= X-Received: by 10.107.140.139 with SMTP id o133mr2619721iod.219.1518550658030; Tue, 13 Feb 2018 11:37:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.52.212 with HTTP; Tue, 13 Feb 2018 11:37:37 -0800 (PST) From: Alex Kiselev Date: Tue, 13 Feb 2018 22:37:37 +0300 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: [dpdk-dev] release/acquire memory barriers and ring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 19:37:39 -0000 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