emacs-devel
[Top][All Lists]
Advanced

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

Re: advice needed for multi-threading patch


From: Stefan Monnier
Subject: Re: advice needed for multi-threading patch
Date: Mon, 28 Sep 2009 20:27:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> In my view, a let-binding should always be thread-local, and I think
> buffer-localness shouldn't affect this.  This is enough of a rule to
> answer your questions -- but it is just one choice, we could make
> others, I suppose.

So what should happen in the following case:
Thread A, running in buffer B1, runs the following code:

  (let ((default-directory "/foo"))
    (with-current-buffer B2 default-directory))

You seem to say that it should return "/foo", but currently it returns
something else.  Maybe we should try to come up with a run-time test to
catch such cases in current Lisp code.  A related case is when a process
filter or a sentinel is run via accept-process-output: we'd need to be
careful to make sure the code is run in the same thread as the code that
called accept-process-output.

> There are some oddities implied by making buffer-local let-bindings
> also be thread-specific.  For example, some buffer-locals affect
> redisplay, so what the user sees will depend on the thread in which
> redisplay is run.

Redisplay should be run in a completely separate thread (at least
conceptually).


        Stefan




reply via email to

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