From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15863A04E7; Mon, 2 Nov 2020 12:17:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3222BE4B; Mon, 2 Nov 2020 12:17:17 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by dpdk.org (Postfix) with ESMTP id 45F5ABBBA for ; Mon, 2 Nov 2020 12:17:15 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id n15so14153268wrq.2 for ; Mon, 02 Nov 2020 03:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=8IixRFMFF3h6c8ZeBfepfXUCUqvM1O2dE522RwVTE+A=; b=AwWXXfHAlFQFH3Fhho7GBLKBUUq6QDd9RYUikoVPEKuisxL0Ci5zLWpDGKRodQUPZ6 5IY6bU2hMWStwuhfhyV4/TCPS95aSzCtdwo6I/sBSvslensE98vfJShj7lsiD75QzIbT EIAQugszOT51e18qot2HsueCbiN2DFBSJ97LCoM1CnlGfHwXADToX4lafbrSjj4oK+f8 HX0lPoMw8T/8hhOqRB48oMNa6t9+DJSG7LL7Ub2hbrPCwFvqpnPss8JDDO8C4BIVLy5w kxq8vInN7ov8YrucQi+F0hmQchrnSO2DIozgojw77hSrQd3JVdStgaOxNS4MHXP0Fh0y 2d8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=8IixRFMFF3h6c8ZeBfepfXUCUqvM1O2dE522RwVTE+A=; b=H5KEasDCM1QOY1uBL9OS9V1Yp7F6P5nYzwHYBVyWfhJwjReEr99YCc0Vy4xfwqgz9Z 8qOUtpNi2kb9TKnEysuKhjspw8NUo7+5XhsZR/EU/2KJSDb/DWjqD6p77Hwg/k5M9k1w L9hS4qKlex/S2c5r+7ikgcZHVSyqLIKBGvDO3jg88CueEHYzstvB9J7Ved/HW3asRHRI WjhyeveMADzpA7NzTjAtIi7f69dCpAAtP2psYJ21N/LL9/xJfZ2YqHaKOTVxfQncqyIA FKN/yOjfBsnmbgu9uo+/Ey3qo4e6RAvXIKHJZKaIyt1qcJWouSxANs3RBhxHbgUSd8Pm mHtA== X-Gm-Message-State: AOAM5334OY7OXg45GIhfOZSGEBhpCvT1ifQGSE+V7UEPHzVlDzZeq2ZH kXtVdBtVkayLq4spW1QznL3ZQ78UP/kZnGdE X-Google-Smtp-Source: ABdhPJwzXBP492/h4tfDZrlTAj2mT4PLfKAc/VVMud68YqihgT+g8jxWhouEvLixdu2VnBBy7fZK6g== X-Received: by 2002:adf:ef0d:: with SMTP id e13mr19453683wro.24.1604315833612; Mon, 02 Nov 2020 03:17:13 -0800 (PST) Received: from [192.168.0.33] (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78]) by smtp.gmail.com with ESMTPSA id z19sm4081300wmk.12.2020.11.02.03.17.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Nov 2020 03:17:13 -0800 (PST) From: Nick Connolly X-Google-Original-From: Nick Connolly To: Khoa To , "dev@dpdk.org" References: Message-ID: Date: Mon, 2 Nov 2020 11:17:11 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [dpdk-dev] [EXTERNAL] [RFC] pthread on Windows 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Khoa, On 29/10/2020 21:19, Khoa To wrote: >> -----Original Message----- >> From: dev On Behalf Of Nick Connolly >> Sent: Monday, October 19, 2020 2:59 AM >> To: dev@dpdk.org >> Subject: [EXTERNAL] [dpdk-dev] [RFC] pthread on Windows >> >> >> The proposed changes are: >> >> 1. An EAL implementation of pthread with a new rte_pthread API. >> 2. The DPDK code (libs, examples, drivers, apps, tests, etc) needs to >> be modified to use the new rte_pthread API. >> 3. There needs to be an option for apps to use an external pthread >> library as an alternative to the EAL implementation. >> 4. Eventually, apps can opt in to using the rte_pthread API if desired. >> >> Item #3 isn't dependent on #1 and #2 - it can be implemented now, >> allowing forward progress to be made without blocking on #1 and #2 which >> may take longer to resolve. >> >> > One concern I have with starting on #3 first is that with this patch, we make pthread semantics mandatory for DPDK core. When new code which references pthread API is later added to DPDK core, and that functionality doesn’t yet have a Windows emulation in EAL, DPDK core may take the dependency on a certain pthread semantics that (a) not implemented before, and (b) is hard to emulate. > > That could represent a problem later, when we introduce the “EAL threads” API layer with a more loose semantics (which can be backed by either external pthread library, or by emulation on Windows). > > Given that a compile flag is not part of any patch submission that introduces such new pthread dependency, how do we detect this problem during said submission? > > Do we know if there is a test or submit requirements which ensures that DPDK compiles on all platforms/environments (including this flag to use external pthread library) to catch new pthread dependencies, prior to accepting any new patch? > > Khoa. I think we are ok here ... the patch doesn't change any dependencies, or make pthreads semantics mandatory for DPDK core. Any changes to DPDK core will be built and tested against the Windows EAL in exactly the same way as currently and the same standards of correctness apply.  Any enhancements needed by the DPDK core will need to go into the Windows EAL as currently.  All that the patch does is provide the flexibility to use an external library to provide part of the functionality of the EAL if the environment requires it (for example to fit with the application's threading model). So, why bother with the #3 patch now instead of waiting for #1 and #2?  Well, based on my experience getting the SPDK running on Windows, I suspect it will be some time before #1 and #2 are done. There's nothing inherently difficult, but there are a number of details to work through and reach agreement about. The patch provides a way of maintaining progress on Windows whilst #1 and #2 are figured out, for example by making it easy for Datapath to use the pthreads4w library in their environment. Regards, Nick