emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-29 8bf4cdcf79: Avoid recursive process filters in lisp/jsonrpc


From: Stefan Monnier
Subject: Re: emacs-29 8bf4cdcf79: Avoid recursive process filters in lisp/jsonrpc.el (bug#60088)
Date: Sat, 17 Dec 2022 20:57:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> Indeed.  I think this points to the need to "spawn" a piece of code to
>> be executed "ASAP" but not necessarily immediately.
>
> Would that be sth like
>
>   (if in-process-filter (run-at-time 0 nil #'piece-of-code) (piece-of-code))
>
> ? ... supposing in-process-filter existed, of course.

I was thinking of something more like unconditonally

    (run-at-time 0 nil #'piece-of-code)

tho abstracted behind a function.

>> This way when a process filter needs to send something in response to
>> what it received, it can just "spawn" the send, so we can return from
>> the process filter before the send finishes.
>
> I guess you can see it that way too.  So there are two ways to solve
> this:
>
> * only process-send-input in process filters makes sense
> * all but process-send-input in process filters makes sense

I assume you meant to write `process-send-string`, but I don't know what
you mean by the above (I understand neither bullets).

> I'm more into of the first persuasion, but I think it shouldn't allow
> output to be accepted when called from within a process filter.

Indeed, as a general rule doing a "blocking wait", such as
`accept-process-output` from within async code (process filter, timer,
etc..) is generally undesirable.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]