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.bugs Subject: bug#48118: 27.1; 28; Only first process receives output with multiple running processes Date: Fri, 30 Apr 2021 17:59:00 +0300 Message-ID: <83o8dvbyyz.fsf@gnu.org> References: <64c194f9-b984-adaa-d5fd-86aa3ed3833a@daniel-mendler.de> <83wnsjc0vd.fsf@gnu.org> <83tunnc0hz.fsf@gnu.org> <83pmybc03l.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40333"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48118@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 30 17:00:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lcUck-000ANU-GY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Apr 2021 17:00:10 +0200 Original-Received: from localhost ([::1]:58912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcUcj-0004CU-Hi for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Apr 2021 11:00:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcUcd-0004CM-3T for bug-gnu-emacs@gnu.org; Fri, 30 Apr 2021 11:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcUcc-0006pI-Qr for bug-gnu-emacs@gnu.org; Fri, 30 Apr 2021 11:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lcUcc-0003Vi-PP for bug-gnu-emacs@gnu.org; Fri, 30 Apr 2021 11:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Apr 2021 15:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48118 X-GNU-PR-Package: emacs Original-Received: via spool by 48118-submit@debbugs.gnu.org id=B48118.161979475713414 (code B ref 48118); Fri, 30 Apr 2021 15:00:02 +0000 Original-Received: (at 48118) by debbugs.gnu.org; 30 Apr 2021 14:59:17 +0000 Original-Received: from localhost ([127.0.0.1]:59526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcUbt-0003UI-9P for submit@debbugs.gnu.org; Fri, 30 Apr 2021 10:59:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcUbr-0003U6-Ne for 48118@debbugs.gnu.org; Fri, 30 Apr 2021 10:59:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48706) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcUbl-0006HR-MD; Fri, 30 Apr 2021 10:59:09 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3162 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lcUbk-00058W-LT; Fri, 30 Apr 2021 10:59:09 -0400 In-Reply-To: (message from Daniel Mendler on Fri, 30 Apr 2021 16:45:25 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205256 Archived-At: > Cc: 48118@debbugs.gnu.org > From: Daniel Mendler > Date: Fri, 30 Apr 2021 16:45:25 +0200 > > On 4/30/21 4:34 PM, Eli Zaretskii wrote: > >> So you say I should repeatedly stop the current process in the filter > >> function in order to allow the other process to take precedence > > > > Yes. > > This is not a good solution. What if I have multiple packages which read > from asynchronous processes? Maybe I cannot control all of the processes > and their scheduling. That's not what I meant. I meant that if your Lisp program launches a subprocess that is known to spill huge amounts of output at high rate, and you don't want to starve other subprocesses, your filter function can stop the process from time to time to give others an opportunity to have their outputs read. > >> since the underlying Emacs handling of asynchronous processes is > >> unable to read from two processes at once? > > > > No. The problem is not the _ability_ to read from more than one > > subprocess -- the ability does exist. The problem is that doing so > > would run afoul of other scenarios. > > Which scenarios break? For example, if the filter function call accept-process-output. Or does anything else that changes output from which processes is or isn't available. > > But the general answer to your question is that Emacs knows nothing > > about the processes, their importance, their output rates, and the > > respective filter functions. > > Okay good. How can I configure it such that two processes both populate > their buffers in a round-robin fashion? What does this mean, exactly? Which quantity should be doled in a round-robin fashion? bytes read from the processes? something else? If the bytes read, then how do you suggest to handle two processes which produce output at very different rates? > I am not happy with the argument that Emacs cannot do any better than > stopping the second process and only handle the first process. I'm not saying that Emacs cannot do that, I'm trying to understand what that would mean in practice. > If you don't want to hardcode the scheduling behavior there could be > some pluggable scheduler. This would be better than having to write my > own scheduling by hand for each `make-process` call. Please hold your horses, you are getting too far ahead of the discussion. I asked those questions for a reason: I think we cannot make any meaningful progress without answering them first.