unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: yyoncho <yyoncho@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 42028@debbugs.gnu.org
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 19:46:56 +0300	[thread overview]
Message-ID: <CACCVLQWXZDzP=RWirouusDcb5pPSw_Mcq9h+hqUVhDsjhrmy0g@mail.gmail.com> (raw)
In-Reply-To: <83366ktol5.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

Here it is an example: If we oversimplify json parsing consist of 2 parts.

1. JSON parsing to Jansson data structures
2. Converting Jasson data structures to lisp data structures.

If we assume that 1 is taking most of the time then we could write the
following code:

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

The same strategy probably could be applied to Font locking with
TreeSitter.

Thanks,
Ivan

On Wed, Jun 24, 2020 at 7:29 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: yyoncho <yyoncho@gmail.com>
> > Date: Wed, 24 Jun 2020 19:17:30 +0300
> > Cc: 42028@debbugs.gnu.org
> >
> > As a side note, this feature will be useful even for the core C part for
> anything
> > that wants to perform async processing not including LispObject.
>
> How will it help that?  The event queue is processed synchronously.
>

[-- Attachment #2: Type: text/html, Size: 1633 bytes --]

  reply	other threads:[~2020-06-24 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  7:14 bug#42028: [Feature Request] 27.0.91; Provide the ability dynamic modules to post events in emacs event loop Ivan Yonchovski
2020-06-24 14:44 ` Eli Zaretskii
2020-06-24 16:17   ` yyoncho
2020-06-24 16:28     ` Eli Zaretskii
2020-06-24 16:46       ` yyoncho [this message]
2020-06-24 17:07         ` Eli Zaretskii
2020-06-24 17:33           ` Ivan Yonchovski
2020-06-24 18:04             ` Eli Zaretskii
2020-06-24 18:38               ` Ivan Yonchovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACCVLQWXZDzP=RWirouusDcb5pPSw_Mcq9h+hqUVhDsjhrmy0g@mail.gmail.com' \
    --to=yyoncho@gmail.com \
    --cc=42028@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).