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: Experiment with threads - no concurrency? Date: Mon, 06 Sep 2021 20:10:05 +0200 Message-ID: References: <83wnntr9i5.fsf@gnu.org> <83o895r4mb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28856"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 06 20:10:56 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 1mNJ55-0007Jj-Qs for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Sep 2021 20:10:55 +0200 Original-Received: from localhost ([::1]:37128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNJ54-0006da-Kn for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Sep 2021 14:10:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNJ4O-0005wH-9O for emacs-devel@gnu.org; Mon, 06 Sep 2021 14:10:12 -0400 Original-Received: from mail-db8eur05olkn2047.outbound.protection.outlook.com ([40.92.89.47]:59231 helo=EUR05-DB8-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 1mNJ4L-0005tQ-9N; Mon, 06 Sep 2021 14:10:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RixakLpsOEvMidBCmh/LwVnbIitHSNCWhaylHQWL+kOjvmDB/tdZpZQcLK0BkeX63TMIZ13IkgYI/2Ao3K/fsb5c+vH/ihk2c7dS4cf4mN2afSpBie/PG0uT6rlwjeEHcdxi9CcYDZh8H0bhb77qJ9zajfSpiBtRtZ1G9AqE11RWsKIxuPutjRlrGuzL/wgTkWovabGrPxh0Q8G69esRKLW2F8jJPnYlE7hZsFm+WalHIDx/iU73LVkZKpCph50iTqprHCNQbL0DMpbPPiQ56bDH5v5u3fXvfEhbLC0c3fcwCnhLGLksANJWhQuGUylyw6T/04n603vSnwbbSuPR+w== 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; bh=XwIpRJuNvG3sHBavOWWvKosaDRrkqmb1RDxWNLu9m8Y=; b=jS7vGUkDOg6UX+ijUZtbtjuNLs9vcGsahRamNgRl2OWN80I31sNxukLcVtbVKl5M/bGA+cY8UTkEj8mL+m6+RcJxhRjpl8WMiTMgtNGliA7OWfRqXCsadBENTTmbB21GHlbuz6/FUJ09dZkNmSBtPldA1pgajlQxsmyd/54GMJ1pb1e9pMTwcUd1ksFFg4Mh416ufxoKRQLErDkRgL4LjKEoGR/PeL9Lg6q84VQcJgcX03A6qD3C0K2dASGZpPiJzM6Ipx2xi397ND1d49SKBGWS0+lhN1zawnr+xev6PiNy6Yk4bQteje4Abt1iFG+fSzuHyGfHEVuY2xFzy3le9w== 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=XwIpRJuNvG3sHBavOWWvKosaDRrkqmb1RDxWNLu9m8Y=; b=XqLqeYFpmK2dj0WM3MNKi1dJQ35it/vY5/zK3jXTnmtPgdJDTlW6HMY9K4kw2bqmeevoEDdjOBcuyeDgpucJ7UXq9fhykN5wVtwH9lZ9JO8rLGFS4E2gF7gDEdeyOSAMTib3kTFUtBT5ZJ558xmPoO9INaVpFgYz5AtbKhm2edBuk4xRU71+TXvPH5rLV5WY+rEHdNaNqj6s7+XwIIw193NoSe0D5opzqJ3GJUdWuvovfEIRiyYMHruiThAnS6+1NEZLkPKr7UrmwOu4ALTuKiwtRW+D+xjII/ofzqWAkf+bg7f4yYEMsXqLpmafrI1eZMo1JHM1H4M4oHBziejOqA== Original-Received: from DB8EUR05FT049.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::45) by DB8EUR05HT106.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Mon, 6 Sep 2021 18:10:06 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc0f::42) by DB8EUR05FT049.mail.protection.outlook.com (2a01:111:e400:fc0f::453) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Mon, 6 Sep 2021 18:10:06 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:DDB3A87979AB38E193F9B4BEACC01718DD74BF4B1EFC3A9740875667C4853C7C; UpperCasedChecksum:FF12A69F7A5DE314151E04512DF1619644F82AF1345CA5D05A12A407A7F5014D; SizeAsReceived:7531; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%9]) with mapi id 15.20.4478.025; Mon, 6 Sep 2021 18:10:06 +0000 In-Reply-To: <83o895r4mb.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 Sep 2021 20:33:16 +0300") X-TMN: [cSvR8NsU5gnNMofUo3qCky0LqQNChGvB] X-ClientProxiedBy: AS9PR06CA0259.eurprd06.prod.outlook.com (2603:10a6:20b:45f::24) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87fsuhtw1u.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AS9PR06CA0259.eurprd06.prod.outlook.com (2603:10a6:20b:45f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Mon, 6 Sep 2021 18:10:05 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: ef309bec-cfa0-40fc-b00c-08d971618e09 X-MS-TrafficTypeDiagnostic: DB8EUR05HT106: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RKpN1UoUt9gW5z6z+sEalup04KSopomsi1Qq2rA+s0x03Q2bUPfsqa8IAaHNs26FWlTCvu6ulYqHPyKRokNzuqTmMHso54YGWZXafjqV8IxKzT1QKu5WHadTO0If+swzMlh5a2KDGyCDPybtMuecxx+kmP3dGsGM+2QmYK1mDpSTPpx59AHr1EyY5txnhRohoWc1beqfR6k7jw5ZE65eA2S24zpsvMOqKViVYOea9YhRyUAc9uXjpkiuFcroDvAFdbhB2E/St4RBvSTW/jNt4Lvoq5Vg1uYQTSWFg5mDGO+G7RlBGxGbKpSBYggddd9i0sPKEC+tiaOqewapiJGCR5rWQZgL93NhZYyTQSbUY9XFRcyHtEFBPPjm6fWgamaopifbWfNW34i+1dTmRLanzwwNKAdzy+QgvfF4dhXnBUlEyjd54q7CqCo/okiXd3kE X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sWRPC5qDhmlVuCNqiV/5alzGM57UTdQnSeCl6k/Ak3K21kFjf8uEYJdw4PxSVRBKG3EfAd+MpXBXklYCnet9L9Db9sRj5BnvZzbj+58kn9xPV6TNwaUunVOQCj0L2xxxaZN65mR5OixziLyRyHwdgw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef309bec-cfa0-40fc-b00c-08d971618e09 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2021 18:10:06.1806 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT049.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT106 Received-SPF: pass client-ip=40.92.89.47; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-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:274158 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org >> Date: Mon, 06 Sep 2021 18:40:46 +0200 >> >> > You shouldn't. Emacs doesn't switch threads on just any I/O, it >> > switches threads when it waits for input from subprocesses, network, >> > and keyboard. >> >> Allright, so in order to exploit I/O concurrency here, the only way is to start >> another emacs process asynchronously? > > Yes, I think so, because in this case the I/O happens inside Emacs > primitives. > >> Could split file list I get from >> directory-files-recursively into say 4 parts, and process files in 4 >> processes. Is there any benefit to use threads in that case? > > No, I don't think so. > >> it takes like 3 seconds to parse all files in lisp dir sequentially > > You have tried that on relatively small directories, I think. It was like all lisp that comes with Emacs :-) alis lisp dir in Emacs source dir, I was looking for defuns and defmacros. Anyway, thanks for the input, I'll look for the tests you mentioned in previous mail, but it feels that I don't have much use of threads. Maybe if I had some long running async process, I could check for results, but in this particular case, I guess I have no use for threads.