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 B017043209;
	Thu, 26 Oct 2023 16:27:55 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 9F0C4402CF;
	Thu, 26 Oct 2023 16:27:55 +0200 (CEST)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id F1089402B5
 for <dev@dpdk.org>; Thu, 26 Oct 2023 16:27:53 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 969965C011A;
 Thu, 26 Oct 2023 10:27:53 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Thu, 26 Oct 2023 10:27:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to; s=fm3; t=
 1698330473; x=1698416873; bh=oygO13fl5ThgSTo03NVaCusWW+CgqbcUYfV
 A7TnnBGg=; b=NmAFLItLwUNp4mb/Kwqg9g9teJQFLcd/uzEcbdEr+Ac5NfXkXdG
 1Jl54qY4DI8eOOYo2jp71IDnWTbibv4leLHCrDMCI0yAJLvuxzY5pfRLHTvFkznT
 KA/wXCCFMfkDnge1M0XVPCNcz2exZrpvSLwlDRLUn4vhXXngGwmkoXmmW3sS4L4d
 lG456DHg4C0tlTSbq4W52+d3ZdRRfRVPGlofQ9Xu6juNufQtwACccScYkqNWNSOj
 pppmdpe+fjx2coO0MTtpjcuEDRvpqxDMV4ZYiPZFeR5kchN9Xdd6q7fRYHL4wbO8
 YtgUBQZeTmuClcExCUl8Z19pvC7a9YACWGg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
 1698330473; x=1698416873; bh=oygO13fl5ThgSTo03NVaCusWW+CgqbcUYfV
 A7TnnBGg=; b=cRxz1RfcTVRHxBRhBGEwXL3GXIBO+p4nyD4GvTO2MuScfFSvLC3
 1DF4Z6D0FqR/zUxVDIc7QvrVE8Av+FE7lYlHn5KxP6GfXji+CSNq+wDun9xG52e+
 uKctwo3YpWos2/kEf8tHI7Y6PBf3sq8qIkyKdVaG5v2CpEwyBtiRQZYgmCuV+aiK
 LBAlT/Cdj1/teyLflrvldFdf1mUBuT6mrfMGIAoRybPJQcKT3ZAZlneIGVN7a0l4
 aNypBDlzQuRcMNcYNfqkcRpSEziXk6oXmR5JfBp53B5dS9+9Jh75osxDypZL073K
 HzRTtqPgLCPEBZrIAK/mQYhlgEPFjPurxBw==
X-ME-Sender: <xms:aXc6Ze957s_yiIqzjIeSNB42xh4kK4SJMTpg6iYdYPyhwXSI8qT1hA>
 <xme:aXc6ZevAYLzMrYOPo-WApXzDiq_GZiYDk4ar3aN5WpwahlJCiat73F2T7WHfLzVMG
 rW39fLAj9ZxbMVK8A>
X-ME-Received: <xmr:aXc6ZUCeibyK-Dt3-9HxVhuCqSTesCEKHEluXuHVjrwbc0VG3-eU2h2Mq33XfmSrF2Su4-wusla5PDf4eRKedFoyQd2H7sA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrledvgdejjecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepvfhhohhm
 rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc
 ggtffrrghtthgvrhhnpedtieffffegfeetlefhkeeuteeuudffjefgleevtdeijedukefg
 veehteehheegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh
 hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:aXc6ZWdNqZJttCNmS438PzGHKWbfg0rDFNDMPeXl5PQdlV6OjKp0UA>
 <xmx:aXc6ZTND2HYWqgMWupo-ksFL89KAOnV5_JhcKrBb5DkOPMXl7RFvKQ>
 <xmx:aXc6ZQkLX5RE2sVPiD4fBG9Ba0bzkR9gMDJ2xx6mSXBLj62v6Lt8yA>
 <xmx:aXc6ZVVDlI4figD2m6iz8t2PfMsBJYajjU3o2FV79y3J6IzV_b5NvA>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 26 Oct 2023 10:27:52 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: David Marchand <david.marchand@redhat.com>
Subject: [PATCH v5 0/2] allow creating thread with real-time priority
Date: Thu, 26 Oct 2023 16:19:35 +0200
Message-ID: <20231026142749.1174372-1-thomas@monjalon.net>
X-Mailer: git-send-email 2.42.0
In-Reply-To: <20231024125416.798897-1-thomas@monjalon.net>
References: <20231024125416.798897-1-thomas@monjalon.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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

Real-time thread priority was been forbidden on Unix
because of problems they can cause.
Warnings and helpers are added to avoid deadlocks,
so real-time can be allowed on all systems.

Thomas Monjalon (2):
  eal: add thread yield functions
  eal/unix: allow creating thread with real-time priority

v1: no yield at all
v2: more comments, sched_yield() and Sleep(0) on Windows
v3: 2 yield functions with sleep in realtime version
v4: runtime warning, longer sleep on Unix and lighter yield on Windows
v5: fix build and increase Unix sleep to 1 ms

Thomas Monjalon (2):
  eal: add thread yield functions
  eal/unix: allow creating thread with real-time priority

 app/test/test_threads.c                       | 11 +-----
 .../prog_guide/env_abstraction_layer.rst      |  4 +-
 lib/eal/include/rte_thread.h                  | 33 +++++++++++++++-
 lib/eal/unix/rte_thread.c                     | 38 ++++++++++++++-----
 lib/eal/version.map                           |  4 ++
 lib/eal/windows/rte_thread.c                  | 15 ++++++++
 6 files changed, 83 insertions(+), 22 deletions(-)

-- 
2.42.0