From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: yyoncho Newsgroups: gmane.emacs.devel Subject: Re: "Asynchronous Requests from Emacs Dynamic Modules" Date: Sat, 31 Oct 2020 10:02:41 +0200 Message-ID: References: <86imarfldb.fsf@akirakyle.com> <86y2jn9j70.fsf@163.com> <83pn4y96ut.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a87e1405b2f2f0c4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Zhu Zihao , ak@akirakyle.com, emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 31 09:04:29 2020 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 1kYlsC-00015u-V0 for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Oct 2020 09:04:28 +0100 Original-Received: from localhost ([::1]:56946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYlsC-0008Pr-0R for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Oct 2020 04:04:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYlqj-0007kA-Jr for emacs-devel@gnu.org; Sat, 31 Oct 2020 04:02:57 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:34293) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYlqh-00053o-RY; Sat, 31 Oct 2020 04:02:57 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id i6so10844129lfd.1; Sat, 31 Oct 2020 01:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zsCll27F0+BtKm3Lk6ePMe8LT/6+SgnIzFkFpndxfLY=; b=qVlI7z+cl9pDEA6GzpqvN0LxCTx5JGfmaQN0tJ9Bv6wEeuuVaY8lIAcb8WsLEW+Tfu lOMUofFXBxGNWae9TG3p6EWckuXdLrXxy1AHik93r/35K7besMtEPbe+JBqZoANGN0Ft ETvSqoz87OwOaqhB1FO9NE7BANfGaVPP6fd5HrzIccvL6fFAv4PfBaGn2vFX0YzY/P6N N/RqQrL9iab6cZftn97MXM4qitpN4oGbiX7lOyOXw0PXHSS/O+Wkd3YIHwVzr/cX8+CL 4wToVTHkjpoba80jSvGHSpbpnHB5inrOuYo/bMoz3GVElS69yMNSO8EAk/swDtKwghul RMkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zsCll27F0+BtKm3Lk6ePMe8LT/6+SgnIzFkFpndxfLY=; b=N55PpG75eO/nJUqKLZo8m0lmHq1MZ1PhiMKkBCpExj/pJihbZBb8s6hV87o2aLidel aidg6FSZoZ064GI5o7Bwg0BoDy+wfQ8SFwu6JbYZ1yCFPNByIYSQCnFakh/ls5iodxWT vpnb/zAKuQxLaCPw6wzVDWWZRvr/sA4Xgi85deQNv4GV30ZtT2UzNkcJIpzcVX890o0m I7N+XhbkPKuLb9KFXu+paJZ71kzb6eJsUgVOhZVBq6v9UtC2Gtsq31hqYxYiGGd2SbCP DmymFt4aNrlHYJkqeOQC+bWBO/NB5rZEArPdY+5flsH84Mo55P83OwbAcM/V/IEr9iZk 0NsQ== X-Gm-Message-State: AOAM532NYIGHPaZvL6jp0qczWWAm7QyGqZbrW4fWgmmctd6K0OJLszCQ oJi299WMzBp3wXZVyGMw8iF305Vr6RmiA4/HTYnmd5CeYFRFV3P/ X-Google-Smtp-Source: ABdhPJznKohE0j7TDClNrRod5yzfg2UPBOktzEscEU+9TxpQTr3x94XfF2aGi6ja0DmJt3NQfXesi9sn8Y8BN3T/LNA= X-Received: by 2002:a19:4842:: with SMTP id v63mr2244131lfa.278.1604131372956; Sat, 31 Oct 2020 01:02:52 -0700 (PDT) In-Reply-To: <83pn4y96ut.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=yyoncho@gmail.com; helo=mail-lf1-x135.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:258575 Archived-At: --000000000000a87e1405b2f2f0c4 Content-Type: text/plain; charset="UTF-8" Allowing condition-notify call from non-elisp threads would solve the problem as well. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42028 On Sat, Oct 31, 2020 at 9:46 AM Eli Zaretskii wrote: > > From: Zhu Zihao > > Date: Sat, 31 Oct 2020 11:18:43 +0800 > > Cc: emacs-devel@gnu.org > > > > What about callbacks? You can pass a Lisp closure to module and call the > > closure from module. > > How will this work, if the callback is called asynchronously? The > Lisp interpreter cannot be reentered. > > I think the method described by Stefan is the only sane path towards > solving these situations. It uses the infrastructure Emacs itself > uses for asynchronous interactions. > > --000000000000a87e1405b2f2f0c4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Allowing condition-notify call from non-elisp threads woul= d solve the problem as well.=C2=A0


On Sat, Oct 31, 2020 at 9:46= AM Eli Zaretskii <eliz@gnu.org> = wrote:
> From= : Zhu Zihao <a= ll_but_last@163.com>
> Date: Sat, 31 Oct 2020 11:18:43 +0800
> Cc: emacs-dev= el@gnu.org
>
> What about callbacks? You can pass a Lisp closure to module and call t= he
> closure from module.

How will this work, if the callback is called asynchronously?=C2=A0 The
Lisp interpreter cannot be reentered.

I think the method described by Stefan is the only sane path towards
solving these situations.=C2=A0 It uses the infrastructure Emacs itself
uses for asynchronous interactions.

--000000000000a87e1405b2f2f0c4--