From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Multithread or multiprocess in emacs?? Date: Mon, 17 Apr 2023 05:26:33 +0300 Message-ID: <83r0sj9rc6.fsf@gnu.org> References: <7w4yjuxtu6rm325oeddtl3fu4oe64fsarru3s4fnh7on5m7udl.ref@wzxqo5pm6es7> <7w4yjuxtu6rm325oeddtl3fu4oe64fsarru3s4fnh7on5m7udl@wzxqo5pm6es7> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7176"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 17 04:26:59 2023 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 1poEa3-0001fq-9I for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Apr 2023 04:26:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poEZa-0001gQ-5V; Sun, 16 Apr 2023 22:26:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poEZZ-0001gA-0U for emacs-devel@gnu.org; Sun, 16 Apr 2023 22:26:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poEZY-0006Ta-OM; Sun, 16 Apr 2023 22:26:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=pcb5qG33bfpaDsAygSdJEopxW2BncGVEGkQ3uZtTdmo=; b=m1x+mx5CtajE n7zNUR435K1J17o8X825rOGH8DxosNL0gYECYfFeq9cBwtc5bKuDtdR9/q3DvWJ25ilGAxwDRFJEk kbTZDhPlnHoE0U7K9K5TOQOLoJV9ScLKX0KV8CwFiHNtcGZxsa3FLcFhxhGun4C0XCE8nCOqzaBv0 CGDRsjvjmyFDDKGR98relbI4giOjknniR2qLrZrONkRLeNrVcjC8A0cpzfivK6eMOwwVz0aRTdQjR EZjUqAzsW0di1MXfj66NOoquuh0p0WKEsxByRkHGFS/jMtAKWvLRCyqLa+sSbUm41+6bT+q6CMmYb k2DNedW3OO1+p3EFvMufng==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poEZY-0001Xo-8j; Sun, 16 Apr 2023 22:26:28 -0400 In-Reply-To: <7w4yjuxtu6rm325oeddtl3fu4oe64fsarru3s4fnh7on5m7udl@wzxqo5pm6es7> (message from Ergus on Sun, 16 Apr 2023 22:50:24 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305353 Archived-At: > Date: Sun, 16 Apr 2023 22:50:24 +0200 > From: Ergus > > Hi: > > Very recently I have seen a code in an elpa package that starts async > subprocesses; but instead of using make-process the package uses > make-thread + process-file. This was to reduce the latency and some > lagging (not evident in my system, but apparently it annoyed the > package's author). > > So, my question is now: Has anyone measured the overhead created by > make-process in critical parts of the code like flymake checkers, or > ispell? and compared with creating new threads? > > If this is somehow significant maybe we may consider adding a helper > thread or thread-pool for some purposes as now the C11 standard has the > threads.h header. > > Is there any work already in this direction? How does Elisp handles > multithreading? Lisp threads in Emacs don't support parallel processing, whereas async subprocesses do. So these two features are not two different implementations of parallelism.