From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 750CBA0C41;
	Wed, 25 Aug 2021 23:57:59 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id F0AA740140;
	Wed, 25 Aug 2021 23:57:58 +0200 (CEST)
Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com
 [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id AA50C4013F
 for <dev@dpdk.org>; Wed, 25 Aug 2021 23:57:57 +0200 (CEST)
Received: by mail-pj1-f49.google.com with SMTP id
 oc2-20020a17090b1c0200b00179e56772d6so5036786pjb.4
 for <dev@dpdk.org>; Wed, 25 Aug 2021 14:57:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=4qOSi6PAHRz1LHaFhcWrfGeNQsvxu7MznRXJQI/TXwE=;
 b=sTCGVg+wAks1Nxh5LG2jF9MDYHX3efZ+qplLRFi2R5KaE6fhg0gfNYlO7ZPvPjEI5Y
 bumxd+tdmxqCDzPZI1uJo5Ely0LXs5QC8pxiCRxKkLRFWjk+QEBK805ofKC0gQ2QZc9h
 lk1wviI+dskzb6u8Zze/Oqu4ebbMs5oxPfYyC6GXJnUxshD7rLdCwxIH9EiRM5EyBBKf
 5PGQ4lXbP9vBah1dlr+99vAURSn9zMg7PpmmAXDqVLyWgXQJ0GUcM7qlrLf/aB1lz+DN
 1p8YfyIHcKDoYAmbdE/hsR/hgdc0JOMVzZmJ330MBVt4FliE3ym9zN8nZkpza5NbTEv0
 fiSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=4qOSi6PAHRz1LHaFhcWrfGeNQsvxu7MznRXJQI/TXwE=;
 b=kC07vX8q2inlG5fUO68N3GafC26+E9tentaDvx2b/1tZeLdiTO0Nr2x/penkb+kLh8
 YOjQP5owtholR1Z2jm0ngK3n+9hRYAJp6KNDJsOxsTNFMbUgfoE5BbsSXRO+TFwgXEl0
 Ay4AZdyV6ODwlQWMSTwQa8W4mo53Ko4dtSOHytKohFjhhoJWZWA0cstdmgn8IMzPjdTg
 0V1W7OGtgoxtg0Tcf7Cu3raO9MQZlNeQSBjUxC5CFggeZVrguYCwCKteDa3sbWT5mOBg
 wapPA4XppSIefJt328IqKeHd3B6MdNubEzcoNvHrHyk1ApCk5C+OoGowJv/boc940WAU
 n/DQ==
X-Gm-Message-State: AOAM530aCs6UwHKTRXVWAEPoAg/1Jdeh5WoiCGj3jx47LlHTfmAeaCJ1
 PBifUkpQeQ1yMvuA+MwMiPyqEQ==
X-Google-Smtp-Source: ABdhPJx2ti3LYKWxsjL+0jKRd/JWfusX2CSNj0oEnA9rAWJyQjX0TZ/AkRGSY85ApoUUMezfg48n/w==
X-Received: by 2002:a17:90a:420c:: with SMTP id
 o12mr466215pjg.101.1629928676674; 
 Wed, 25 Aug 2021 14:57:56 -0700 (PDT)
Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123])
 by smtp.gmail.com with ESMTPSA id d22sm467909pjw.38.2021.08.25.14.57.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 Aug 2021 14:57:56 -0700 (PDT)
Date: Wed, 25 Aug 2021 14:57:53 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Cc: Mattias =?UTF-8?B?UsO2bm5ibG9t?= <hofors@lysator.liu.se>, "dev@dpdk.org"
 <dev@dpdk.org>, "olivier.matz@6wind.com" <olivier.matz@6wind.com>,
 "lucp.at.work@gmail.com" <lucp.at.work@gmail.com>,
 "david.marchand@redhat.com" <david.marchand@redhat.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>, Ruifeng Wang
 <Ruifeng.Wang@arm.com>, nd <nd@arm.com>
Message-ID: <20210825145753.57ea4d1d@hermes.local>
In-Reply-To: <AM8PR08MB5810ECA5F477F0BF930A15FC98C69@AM8PR08MB5810.eurprd08.prod.outlook.com>
References: <20210730213709.19400-1-honnappa.nagarahalli@arm.com>
 <20210802051652.3611-1-honnappa.nagarahalli@arm.com>
 <2caf4e93-6a57-503d-fafb-22ea6a4b1982@lysator.liu.se>
 <AM8PR08MB5810ECA5F477F0BF930A15FC98C69@AM8PR08MB5810.eurprd08.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [RFC v2] eal: simplify the implementation of
 rte_ctrl_thread_create
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Wed, 25 Aug 2021 15:23:08 +0000
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com> wrote:

> <snip>
> 
> > 
> > On 2021-08-02 07:16, Honnappa Nagarahalli wrote:  
> > > The current described behaviour of rte_ctrl_thread_create is rigid
> > > which makes the implementation of the function complex.
> > > The behavior is abstracted to allow for simplified implementation.
> > >  
> > 
> > Have you considered using a POSIX condition variable instead of atomics for
> > synchronization?  
> No, I have not considered. The current implementation is complex because of the error handling of pthread_barrier_xxx APIs. I am thinking similar complexity will come in with the condition variable functions.
> 
> I am using atomic variable in this patch to synchronize which does not need much error handling which simplifies the implementation.
> 
> <snip>

The problem with condition variables is that it then adds a mutex
as well.