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: Tom Tromey
Subject: Re: advice needed for multi-threading patch
Date: Sun, 27 Sep 2009 14:59:02 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

>>>>> "Stefan" == Stefan Monnier <address@hidden> writes:

[ releasing the buffer lock when yielding ]

Tom> I think this means it does not suffice to keep a simple per-thread count
Tom> of buffer-local bindings.

Stefan> Indeed.  The lock should probably be on the buffer-local binding itself
Stefan> (i.e. the combination of the buffer and the variable).

I looked into this a bit; I think it can lead to deadlock too easily:
 Thread A acquires V1 and requests V2
 Thread B acquires V2 and requests V1

Instead, I think we could remove the buffer lock.  Because we currently
use cooperative threading, most buffer operations are atomic with
respect to thread switches.  So, it seems that if we fix the bindings
problem, we can probably just remove the buffer lock.

What do you think of that?  Are there problems I've missed?

I wrote some elisp to modify the Emacs sources to use buffer accessor
macros everywhere (it handles like 90% of the references, a few tweaks
by hand are also needed).  The only thing remaining is to fix up the
swap_in_symval_forwarding logic, which we have to do anyway.

Tom




reply via email to

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