emacs-devel
[Top][All Lists]
Advanced

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

Re: Threads in emacs implementation


From: Ted Zlatanov
Subject: Re: Threads in emacs implementation
Date: Fri, 17 Jun 2005 10:09:38 -0400
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.3.50 (gnu/linux)

On Fri, 17 Jun 2005, address@hidden wrote:

> A huge amount of the actively maintained state in Emacs is stored in
> global variables (often buffer-local of course, but still "global"
> as far as threads are concerned).

Thank you for the clarification.

I'm thinking of ways to avoid the stack penalties the other proposals
involve.  Could we allow only secondary threads with thread-local
variables and forked copies of globals?  Then, to modify the main
thread's version of a global variable a special protocol must be
followed (through the VM).  Threads wouldn't be able to access
existing buffers and buffer-local variables without going through the
VM protocol, either (but they can create their own buffers, which will
be isolated within the thread).  The ideal thread would be a pure
function (if I remember my definitions right, a pure function f(x)
depends only on x).

This will make threads more of a utility than a true built-in, and
threaded code would be written especially for that purpose.  Existing
code would continue to run without changes - this will save us
rewriting a huge amount of code.

Is this feasible?  Would this kind of limited threading be useful?

Ted





reply via email to

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