From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ivan Yonchovski Newsgroups: gmane.emacs.bugs Subject: bug#42028: [Feature Request] 27.0.91; Provide the ability dynamic modules to post events in emacs event loop Date: Wed, 24 Jun 2020 20:33:29 +0300 Message-ID: <874kr0gyhi.fsf@gmail.com> References: <875zbh0wbf.fsf@gmail.com> <83bll8ttet.fsf@gnu.org> <83366ktol5.fsf@gnu.org> <83zh8ss87t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="23700"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.3.7; emacs 27.0.91 Cc: 42028@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 24 19:34:11 2020 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 1jo9Hm-00060l-Bk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 19:34:10 +0200 Original-Received: from localhost ([::1]:46938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo9Hk-00068R-Tm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 13:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo9He-00068J-74 for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 13:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jo9Hd-0003G3-U9 for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 13:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jo9Hd-0000Ur-RF for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 13:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Yonchovski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jun 2020 17:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42028 X-GNU-PR-Package: emacs Original-Received: via spool by 42028-submit@debbugs.gnu.org id=B42028.15930200231882 (code B ref 42028); Wed, 24 Jun 2020 17:34:01 +0000 Original-Received: (at 42028) by debbugs.gnu.org; 24 Jun 2020 17:33:43 +0000 Original-Received: from localhost ([127.0.0.1]:38822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo9HL-0000UI-6h for submit@debbugs.gnu.org; Wed, 24 Jun 2020 13:33:43 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:40158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo9HG-0000U0-G4 for 42028@debbugs.gnu.org; Wed, 24 Jun 2020 13:33:41 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id h5so3094995wrc.7 for <42028@debbugs.gnu.org>; Wed, 24 Jun 2020 10:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=YvC750XB6C+fj8RXf9dA3Nj/oX/5hjx/htOxY5zylo4=; b=Fk192yTb10Pb/TRMFgBnkk3jbM8HHYYGaveNqeoIGNNumSqeCpNDge+9MnlbNcC6TU 7m3ee6PPNwTWKUa3aPVBY8DghQ5ZIh+h8YlIfNBk2Or/0evcRTV1OicyNGDyVHwkGJeu isNO6mcp/jby8mZgkkVtxw5lAiWF9ottdaBRnHZr9BgQPJIYf0FCv13rsxIR8bhLceYI Fx0o9THkksO6h/5OKybOiEWlsWfkZ6EpTXiyS+fqpiGZAOF/A+kk1efEUWA48kSgkjII dXkQGdURql5vG8rNmWXkUEUdDQT+3LUKVYfARhAGvjp6rxX/y9JL8u384xtN+2uwXYTt As7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=YvC750XB6C+fj8RXf9dA3Nj/oX/5hjx/htOxY5zylo4=; b=a1KsT/TSgMtSWXCxM+mjrSn44ex16ffgZQXMWKwjJPB/RHTaeFiyBvPCHV3z7KjXWb HnbqFXQQ6+M5D+JSvG6cBXUVWBc4f8mnxekvX4/LVgrV7X05QO+4WERyzl0rDlGMaIaR O2ghHWOmLXLWcBOlyh4jZb7YaoqTRgNQf5HIh9Upb3a1CIxAOr/I98J4DMQE2S8UY07o LkbyJrayBp1KqcjM6diu749iFU9JhQE4U32uiSGOPdgVbLh7LZ+l63Ao/jF1sJEUy9Ik p3AVMXZgTmcflZAGEVfIEm/IbfpMiB2oEgmjKe5t6FvQlKggXrfAuUoO2E7wbMPk/KCS xjcA== X-Gm-Message-State: AOAM530M/Ln5saONRruaiBD8BRlOJoA3eAyGa7xDWSi21n51WiOtBmDn qD7EDhn5pJ7Yi2Isayy/531wDuc9 X-Google-Smtp-Source: ABdhPJztjr8G7wv4fmnnkhNgZ0zXIzjTvB9dLyxHyI2jaqH7MSScHeUNMTfM7vtAeSuzBABiV9+iSQ== X-Received: by 2002:adf:97cb:: with SMTP id t11mr32166070wrb.314.1593020012046; Wed, 24 Jun 2020 10:33:32 -0700 (PDT) Original-Received: from kyoncho-H87-D3H ([2a00:4802:28d:9e00:8c64:bcc8:970f:40b]) by smtp.gmail.com with ESMTPSA id u20sm8590284wmc.44.2020.06.24.10.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 10:33:31 -0700 (PDT) In-reply-to: <83zh8ss87t.fsf@gnu.org> 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:182350 Archived-At: Eli Zaretskii writes: > Does it? Did someone time these separately? IDK, this was just an example. >> start(string, callback) -> convert string to char* -> post it to worker thread -> worker thread does the parsing >> -> worker thread post to main loop -> main loop converts Jansson ds to lisp ds -> main loop >> calls the callback passed on start > > You cannot easily post to the queue from a worker thread, because the > queue cannot be posted to asynchronously. AFAIK this is not possible at all - thus this feature request. > > And I lack the larger picture: how would this work within a framework > of some Emacs feature? E.g., how will this processed be triggered, > and by what kind of trigger? The goal users to be able to handle more usecases. ATM the only way to achieve that is hackish as described here https://nullprogram.com/blog/2017/02/14/ + several practical usecases. > Again, I don't see the wider picture. Are you familiar with how the > current JIT font-lock works? If so, can you explain which parts of > that will be replaced/modified, and how? AFAIK the initial tree-sitter parsing (which does not involve anything emacs related) may take 200-300ms. In other editors (e.g. vscode) this part is not happening on the UI thread but in some extenal background thread which then passes the AST to the main UI thread to do the actual fontlock. IMO this model might be replicated in emacs in the event of TS integration. Thanks, Ivan