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 3921EA0547; Thu, 29 Apr 2021 18:28:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2212E410F1; Thu, 29 Apr 2021 18:28:30 +0200 (CEST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by mails.dpdk.org (Postfix) with ESMTP id EE35F410DD for ; Thu, 29 Apr 2021 18:28:28 +0200 (CEST) Received: by mail-lj1-f178.google.com with SMTP id s9so19242637ljj.6 for ; Thu, 29 Apr 2021 09:28:28 -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=oZqKSX2FEJV+/hUP6X/MXDF9bNxDgf2Ne51jadWzSH0=; b=K0ytVPW1Gs9b/uTDdtrqDo0CbSq0KqD11pDq+28Dkq9l4bk6Ampy+OkAQyoACEi2c2 x8mD2UYUgUwU3nvNZfU8bu3GtG4d7i1RyHpNsizYxzfaDGwD15DjGodnmLsOFGT9AO8v CODo1KFJ4RUvx8fywJXGPsBBvAhC982KJvSu77w+DSHUNwNLrqE10NF5BoaUilG8p8g4 uBhnc5BVFEhdnDcbkw+xU+mB5FLefkAYilv6HYtqMjLEnXkUBhfgpIEeyp+mZvfJgdsd FbQaLppJs3E6Fi9t1kbDADcHJRJgadXFK562Jdd7UU8rMiPWnHqinEqB0aqDMSldXiVx oTqA== 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=oZqKSX2FEJV+/hUP6X/MXDF9bNxDgf2Ne51jadWzSH0=; b=MXFh5VtxRnk08D5bgpCK5Q5YLJaBTSYh6oT5YzOuUcJjyIF4B7GqwpEaS4V+aumwu7 qhQh7iS9v0qhksk0PRD7f197L/0+BeA7MF4YrEfyXLswKLRoAfnbuCMxCPLrzU9R2S1p ouaNirrDDAiHwA99cOqTUE1iAaRDy51U3+iuFrMwigYMchVXY18yZOyon7NBeQva2lqh G3sZ7S4c7QCtCIRW5zEgL+yMZqolsNgwo/mvxyudmUfr80oj9K4WiPvyDWdLdPmtSoKS HTBRKT/Ww1mfVcWwBbpi2wPiAceiRtU8xCuOlLwWLrlNb1tvoOBxErxyTLpaFjTFx4RH +zCA== X-Gm-Message-State: AOAM532TDsoxwuz1wM0IdgZTpNGwsPKu2RhguwQL13jWCA/MBmzcuC4l EDjjT0nmkCeKEOy7NzOXxbQ= X-Google-Smtp-Source: ABdhPJySZKukifYQmyuE9+goWIH81msRetJdsug0fpLhXNm+zytV5oTXNMAuWuRRU+OckQApb1SRLw== X-Received: by 2002:a05:651c:210:: with SMTP id y16mr363096ljn.210.1619713708528; Thu, 29 Apr 2021 09:28:28 -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 n13sm23043lfa.209.2021.04.29.09.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 09:28:27 -0700 (PDT) Date: Thu, 29 Apr 2021 19:28:26 +0300 From: Dmitry Kozlyuk To: "Kinsella, Ray" Cc: Thomas Monjalon , Narcisa Ana Maria Vasile , dev@dpdk.org, 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: <20210429192826.6a2b1c9d@sovereign> In-Reply-To: References: <1617057640-24301-2-git-send-email-navasile@linux.microsoft.com> <1617413948-10504-2-git-send-email-navasile@linux.microsoft.com> <20210429035029.349d3306@sovereign> <33056936.xYFp2keEGj@thomas> 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 v6 01/10] eal: add thread id and simple thread functions 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-04-29 13:05 (UTC+0100), Kinsella, Ray: > On 29/04/2021 08:44, Thomas Monjalon wrote: > > 29/04/2021 02:50, Dmitry Kozlyuk: > >> 2021-04-02 18:38 (UTC-0700), Narcisa Ana Maria Vasile: > >>> --- /dev/null > >>> +++ b/lib/librte_eal/windows/include/rte_windows_thread_types.h > >>> @@ -0,0 +1,12 @@ > >>> +/* SPDX-License-Identifier: BSD-3-Clause > >>> + * Copyright(c) 2021 Microsoft Corporation > >>> + */ > >>> + > >>> +#ifndef _RTE_THREAD_TYPES_H_ > >>> +#define _RTE_THREAD_TYPES_H_ > >>> + > >>> +#include > >>> + > >>> +typedef DWORD rte_thread_t; > >>> + > >>> +#endif /* _RTE_THREAD_TYPES_H_ */ > >> > >> pthread_t type in pthreads-win32 and winpthread is not 32 bit. > >> DPDK will have different ABI depending on a threading backend used. > >> Apps must know it at build time then. How do they discover it? > >> This is worth a warning in commit log and docs. > > > > Not sure this is an acceptable behaviour. > > In my opinion, ABI should not vary. > > +Cc Ray > > > > So pthread_t on Win32 should just map to the HANDLE datatype. > Which if memory serves is in fact a DWORD on Win32. DWORD = uint32_t, HANDLE = void*, which are of different size on x64. I suggest an opaque 64-bit value to fit pthread_t from MinGW's winpthread. Only pthreads-win32 has a bigger pthread_t, but we don't have to support it. > So I suspect that pthreads indirection is probably be just providing a circuitous route to end up in the same place, a HANDLE > > IMHO > To absolutely guarantee no ABI change, we ought to be passing back void * not rte_thread_t. Yes. Only I'd use a type-safe version: typedef struct rte_thread_tag { void *opaque; /* or uintptr_t per Tyler's suggestion */ } rte_thread_t;