From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) by dpdk.org (Postfix) with ESMTP id 691B91B2B4 for ; Tue, 13 Feb 2018 20:43:02 +0100 (CET) Received: by mail-io0-f178.google.com with SMTP id g14so16358155iob.9 for ; Tue, 13 Feb 2018 11:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=PVlO9pESo6hjVA3iLCRWAiB85++jOmM/tlx9qVnxoV4=; b=frC6M6RdWVDktKa4RWJ9Dsnv86CaHUXweeSxzoX2h5CE5ASJhcLoCemxZZhDVd8ECI IBe0kOPmQZlHE3sLcqH9OI1NAIKejmox1NKnOMevsy9MhP40MzOh7eGMFIrZG5VUrTwJ lm33GkBUtx2qw8oBcfc5+C2jwtMEY0AA4bgYh1BmomUERnHwoPE5mbrwjhCGppMkoEx2 KLN7q6M8kTc9yMYS923vPx0cPykTFuuFJtNODTcNl08VWWHLD/7LAtFJQAPrfEF0yBcI cetpPJ8rvlUvJxO4nUEUPeHIEa0EsocgbwcuoEkdlwk+HNcqnDjrlhJ7Gey3MB3LSyoH bO0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=PVlO9pESo6hjVA3iLCRWAiB85++jOmM/tlx9qVnxoV4=; b=bOkSrujHHy4Kmb3JH6UT8xAI+FmBDGHinFwHXlnUgToGoe6TxMooKtKD5t1ip5nHAJ weSpswRmolLwFJE1/dtYaElaTgTifu7LMi7vXr8V91T1Q8YTuUGTnF6GfYa4WdN5X1bX HrfmCQXK7H8Ps1JB2xQvqnos6AiTKHL5FWeXXizZJt7bVZ7dG5kBT1yh3+9GNFebA7pF 1RH9ceDeaOpfbr7SMRwBuicX2hJVdryHNcYL1caI3ux55qqEKvkJPetU7y80fp19xcYp jvk+l65qUareAiypMR064g1YOykVaI7TATeeKTq4xAYv171QsBRHmVUc7XSntduceYGv UrmA== X-Gm-Message-State: APf1xPCAMxZMc/wWQNP1VG53m96fh22RYmwUG4s9Jfe2czYTC9F1lgz9 kqtgreQ/0PqUkQ1gZsMctta2Qi6Gmk8HIVpb9UXpWA== X-Google-Smtp-Source: AH8x226UFCTNagiLIzNUBOzKgH+BHn0f0HysF29YS1OCpjquuPqmOw4WKEDUW6jzSosov/a5z6kPsWz4thP87LSWxnk= X-Received: by 10.107.18.70 with SMTP id a67mr2517626ioj.190.1518550981458; Tue, 13 Feb 2018 11:43:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.52.212 with HTTP; Tue, 13 Feb 2018 11:43:01 -0800 (PST) In-Reply-To: References: From: Alex Kiselev Date: Tue, 13 Feb 2018 22:43:01 +0300 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [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:43:02 -0000 I am sorry. I should've posted to the user list of couse. My mistake. 2018-02-13 22:37 GMT+03:00 Alex Kiselev : > 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