From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F48DA0A0C; Sat, 19 Jun 2021 00:48:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8A5A40E32; Sat, 19 Jun 2021 00:48:40 +0200 (CEST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mails.dpdk.org (Postfix) with ESMTP id D4C7A40696 for ; Sat, 19 Jun 2021 00:48:38 +0200 (CEST) Received: by mail-lf1-f51.google.com with SMTP id r5so19134069lfr.5 for ; Fri, 18 Jun 2021 15:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7NUWBSs70TvLFeTnTTO9gE+Yc2CK2lNg1sP/u4yPwvM=; b=NrY7MdHahU8E7RHEbJF2IBOfsUwLkDkf/8DaSRKPupa9OkS6pNsgC2uzNzsTdyqcTx Y4eyIR/ThMqgLjzwSDSQAodIYsToRVVVCV9ARKbEsdvGXeiiL1JTq4TqMTNAwn+n0ksD JObi80y9kBWGYcnKbRfAMnz3uOzUgB9Q/YbJcYHcf6TN+KgvhjnRuRCdeemTubiC9/e9 SeUfrfeUk4nFQIxAjRs13vFqJrsJ096zeajO/6Yb6zUfcXbw9QWG/sKswBFXDv/kQmmn sK+ChnEQhFh8wYqSiBO43AVsnfnr21CeLNKcl6RFAYGqQRjTGUwzLnBTQU4A7maU9O5J cOUA== 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=7NUWBSs70TvLFeTnTTO9gE+Yc2CK2lNg1sP/u4yPwvM=; b=UAkm/iruVx8YCn8oRS2ZFqQevu/jl4GwLVYOABdh9EsiXXsn+DXVbxFEqOn4U5TjNZ wunFM3QeXwo5Zh7m3xHnp6vZMHNDVbiAB/o27SPXlXsOUsW+cuJaxL3G8qnakQ2IIS39 wVuK7svjU/92uRsmVNU42rJI4igDeFHjooHKwfEQ9FwJG9XmeFB9mcCiPZARntkVAeK2 y0OMXNELXO7d3MyKCi8GCJoO7R1ek7eV8E55HOTXVjrjtatOV2aAQuD+HIFPL6Lf/RTK thiY034Ad1K0N08iTh3hc1NlSqSkSDEsHeYZSLQW8425SKHDySe5Msem79Yz+Q6vgC/0 QB8g== X-Gm-Message-State: AOAM5339RO2Uxk4WxSRqIKjljjN9UuLSu+pAmKFLdQjbn3aKLlWdb9DK nKz9MymH84mZGVzFBNeXcBM= X-Google-Smtp-Source: ABdhPJyocwZ0OiK4EWTQ39VM9wh0VkXKf42OfalquqV9cGmVQ5MczljTqBNhhPJChMaHNJI3fTpzwQ== X-Received: by 2002:a19:6141:: with SMTP id m1mr4716676lfk.610.1624056518350; Fri, 18 Jun 2021 15:48:38 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id f9sm1039439lft.63.2021.06.18.15.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 15:48:37 -0700 (PDT) Date: Sat, 19 Jun 2021 01:48:36 +0300 From: Dmitry Kozlyuk To: Narcisa Ana Maria Vasile Cc: dev@dpdk.org, thomas@monjalon.net, khot@microsoft.com, navasile@microsoft.com, dmitrym@microsoft.com, roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com, bruce.richardson@intel.com, david.marchand@redhat.com, pallavi.kadam@intel.com Message-ID: <20210619014836.24ed5dda@sovereign> In-Reply-To: <20210618214102.GB26950@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1622849908-5710-1-git-send-email-navasile@linux.microsoft.com> <1622850274-6946-1-git-send-email-navasile@linux.microsoft.com> <1622850274-6946-7-git-send-email-navasile@linux.microsoft.com> <20210609020409.0c1fb82b@sovereign> <20210618214102.GB26950@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v9 06/10] eal: add thread lifetime management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2021-06-18 14:41 (UTC-0700), Narcisa Ana Maria Vasile: > On Wed, Jun 09, 2021 at 02:04:09AM +0300, Dmitry Kozlyuk wrote: > > 2021-06-04 16:44 (UTC-0700), Narcisa Ana Maria Vasile: [...] > > > + > > > + HANDLE thread_handle = NULL; > > > + GROUP_AFFINITY thread_affinity; > > > + struct thread_routine_ctx *ctx = NULL; > > > + > > > + ctx = calloc(1, sizeof(*ctx)); > > > > Why use `calloc()` for a scalar? > > ctx is pointer to struct that holds the thread function pointer and its arguments. > Did I misunderstand what you meant? `calloc(size_t n, size_t size)` mainly exists for safe array allocations, because multiplication in `malloc(n * size)` may overflow. You are allocating a singular value, i. e. a scalar, so the choice of `calloc()` over `malloc()` raises questions. Nevertheless, it is harmless and works correctly. Consider it a nit.