From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] support for accessing CPU/core count (processor-count) Date: Sun, 10 Oct 2021 20:13:07 +0200 Message-ID: References: <87h7dpgues.fsf@omarpolo.com> <87v925f9m0.fsf@igel.home> <87o87xf5yc.fsf@igel.home> <877dekg594.fsf@igel.home> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30835"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Omar Polo , Campbell Barton , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 10 20:14:36 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZdLH-0007oU-4G for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Oct 2021 20:14:36 +0200 Original-Received: from localhost ([::1]:36808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZdLF-00017w-JH for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Oct 2021 14:14:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZdK0-00006T-8T for emacs-devel@gnu.org; Sun, 10 Oct 2021 14:13:16 -0400 Original-Received: from mail-oln040092074054.outbound.protection.outlook.com ([40.92.74.54]:43588 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZdJv-0001W9-QV for emacs-devel@gnu.org; Sun, 10 Oct 2021 14:13:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mh85vGRDazSzuGmgtb7eovBgKdUV98suLr5TtojHFqiCY9wnXldWEkqzVNYmv+nHcl0GxMeAarPCPnY81FLfSrRhEvTxaYZgDxwixGe1MGQlI9modzCwltn4/KBU8/ob1bnDC358ORif3ak2miu+HwuiALxsqGeL1XINX4Wl18qV5LQhgndU3mTvl0zh4IZSXOXEVUZdsodqm9i8cWFkAdsEDEELKgQLrBFRcvaHxecifK7LsMVgkFUBVn5g6VBoO0xnnApN/uTwKjdW1crfZl236XLPRht4PdMXujOmKVHgfVzeGDgub3Pi6E7SWo8xNi2kIFVDiER6js4YB5AcVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CD1Y2xVg57V6kjH2Dp06rbHv1/k7+3VTiTYhsb/3Sd4=; b=Wduc8en85v9ZDAK/3Iwx2ekNRYXhicxWewB33mO/233VJDTp6CYc7rNg4X3iCQWyGMwErTLfvM2poEFil+nPcq2oF6zWV3VLvi25P0cuFJMy/LQE0WFPWAA3FF+WiLcfJlZPzIXmIiLu5BSPUK0bmwCq7kFPYkwKe5BBVOsl+b39JJgt80XyXOX3ZIT3Y2yyNpNDVghgSuktp0qGmYMsWoeiZV9JxkA4wUoEylL/nL67vUlipWT0JZJNpqosA2CM8g4F/XiNx/x7hilZsUo+Az+1uaaaPK6/zyIqQAU7MjDfnunBc6CdDIowQRLPE6LV+9U2Clvch6guVgsrDXON8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CD1Y2xVg57V6kjH2Dp06rbHv1/k7+3VTiTYhsb/3Sd4=; b=GOlw+9wD1Bj7RK2tIwm3kE/eEvowJJLqIFAh+ZbJYt8PjmSvX4PsjzKcCpk7IROTUJ+S4iAKwW2KdGoAvGmklNGCQQ1hsNimRCCKqJixYLIUf3kYCe3TzNJ9fzqabgs82hRwnFJb88yQ4F5a5v/cD1eTot/wDwEltspt/k6nGay8sfQzn/ZUsaqn6jKDhNllUGRb2zbK0wiFvuNWd63JmiZzLuxSc3bVPCFSFrNESyN5uXCwaYvv9akmUgZrCLhZhrHQHcRMWJojpGzPUJgEqF/5h8QfDJJdawzkaURTjk1LIOPwuGXJeVGccY9rubcl9XvzaTW+H5LpmnS8g0NTAg== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3987.eurprd09.prod.outlook.com (2603:10a6:208:19a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Sun, 10 Oct 2021 18:13:09 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c05b:e2ca:5b8a:56d2]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c05b:e2ca:5b8a:56d2%9]) with mapi id 15.20.4587.025; Sun, 10 Oct 2021 18:13:09 +0000 In-Reply-To: <877dekg594.fsf@igel.home> (Andreas Schwab's message of "Sun, 10 Oct 2021 19:27:03 +0200") X-TMN: [pEW19S1NbfMDl3tn8Oo/gFC86gBxjJap] X-ClientProxiedBy: HE1PR0701CA0050.eurprd07.prod.outlook.com (2603:10a6:3:9e::18) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <871r4slpe4.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by HE1PR0701CA0050.eurprd07.prod.outlook.com (2603:10a6:3:9e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.4 via Frontend Transport; Sun, 10 Oct 2021 18:13:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b37806da-5272-46e0-17fc-08d98c199d4d X-MS-TrafficTypeDiagnostic: AM0PR09MB3987: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: javVQ7aCzMZpWUL5/fLWMaO4zb/K/trSLMDhBfAPRiolwrSeyeOB3tCT37FDewwq8r0ZgyryOKoc1NoH0QCO9momwmqQh7/7jbZniyHoXr/PpFyqTPXhIRKqDt3Z2AQXIhLWkYzmu/jW4noOuiOenz6+4LzuSrwIh9hWLfUjUDE9qq5k+w1pDb+lrB64lzclx3usfmHadiN//VXlyw+4b+Yxl8sLY/xo98UITautzebEJVerZrN+gzYeaO0ZeZfJs8yZBuP6+Z0NMOmE1C414OYtDYU9ELKTQWUD5ImsASSYJN+AP7LewDVlK5hMFHP03WLs5450vqb7q7UhvR9EvX1pfn8mai3CXpf2iKbhUZPas8d3OJDLeMwMIIcCQ3+9CNkc5GKmljyy24j2A8RT3+YU4JcGuUpZlDD+urFpahei+J1jRKJGEiekHs6P3xew X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UhI7CqMI4v8UsHdmB7Hr7kb4Wyg7WaSyjvIdE4PxVumTgtDh5NfhfYCGFOMWkHOgJlHUenfX/4cWYxRhM8xC9u6jdzlUeqWoPmWd9SAR29VLG2Oyb+nC3ukzhx3dgZieFbSDfAueETJPYAqMJZpOxA== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b37806da-5272-46e0-17fc-08d98c199d4d X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2021 18:13:09.3629 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB3987 Received-SPF: pass client-ip=40.92.74.54; envelope-from=arthur.miller@live.com; helo=EUR04-DB3-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:276685 Archived-At: Andreas Schwab writes: > On Okt 10 2021, Arthur Miller wrote: > >> Andreas Schwab writes: >> >>> On Okt 10 2021, Arthur Miller wrote: >>> >>>> Does it differ between kernel versions or in which way is it architecture >>>> dependent on Linux kernel? I suggested this only for gnu/Linux. >>> >>> Every architecture is different. Why reinventing the wheel if the >>> standard library has already worked out all the details? >>> >> ? Which standard library? C? Or what? >> >> I think there is some missunderstanding going on here. I didn't oppose to the >> OPs idea with patch; I just said it would be more practical to implement it in >> Lisp than in C. >> >> I gave him /proc/cpuinfo for gnu/Linux > > That is not portable. It is much easier to let sysconf do the heavy > lifting, instead of reimplementing it. We seem to be talking past each other. I don't see why would want this as a C primitive. Sysconf is portable only on posix systems. It covers linux and *bsd kernels, but you still have windows left, and some hypotetical future os. I think it is better to implement it as a Lisp function, as Andrea did in native comp. Less to maintain and don't need to be recompiled if some future non-posix system need to be added.