[Top][All Lists]
[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
- Re: advice needed for multi-threading patch, (continued)
- Re: advice needed for multi-threading patch, Chong Yidong, 2009/09/18
- Re: advice needed for multi-threading patch, Stefan Monnier, 2009/09/21
- Re: advice needed for multi-threading patch, Tom Tromey, 2009/09/21
- Re: advice needed for multi-threading patch, Tom Tromey, 2009/09/22
- Re: advice needed for multi-threading patch, Stefan Monnier, 2009/09/24
- Re: advice needed for multi-threading patch, Tom Tromey, 2009/09/24
- Re: advice needed for multi-threading patch,
Tom Tromey <=
- Re: advice needed for multi-threading patch, Stefan Monnier, 2009/09/27
- Re: advice needed for multi-threading patch, Tom Tromey, 2009/09/28
- Re: advice needed for multi-threading patch, Stefan Monnier, 2009/09/28
- Re: advice needed for multi-threading patch, Ken Raeburn, 2009/09/28
- Re: advice needed for multi-threading patch, Stefan Monnier, 2009/09/28
- Re: advice needed for multi-threading patch, Ken Raeburn, 2009/09/28
- Re: advice needed for multi-threading patch, Tom Tromey, 2009/09/28
- Re: advice needed for multi-threading patch, Ken Raeburn, 2009/09/29
- Re: advice needed for multi-threading patch, Tom Tromey, 2009/09/28
- Re: advice needed for multi-threading patch, Giuseppe Scrivano, 2009/09/23