[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [0/10] threads for emacs
From: |
Tom Tromey |
Subject: |
Re: [0/10] threads for emacs |
Date: |
Thu, 09 Aug 2012 13:59:48 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Tom> Plus I have a to-do list...
I thought it would be worthwhile to post it.
First, I think the patches I've posted are all (except maybe #9 and #10)
necessary for a first cut at threads in Emacs.
There are a few other things I think are necessary before the feature
can be easily useful:
* Documentation
* Emacs Lisp condition variable code. This is probably not too hard.
* Changes to the process code so that a process can be restricted to
having its output accepted by a single thread. (In fact I think the
default should be to do this for the creating thread.) This avoids
introducing bugs into lisp code that may currently make assumptions
about let bindings visible to process filters.
* Hook into the Emacs I/O code so that the global lock is released when
a thread enters 'select' (and maybe other primitives). I think this
is a bit harder than it sounds, mostly because I think you don't want
multiple threads to select on the same fds. It probably requires the
process changes.
* Figure out what, if anything, to do about the lisp debugger,
redisplay, and the keyboard when running a "non-background" thread.
* More tests
Some nice-to-have things:
* Have mutex-lock automatically detect deadlocks.
* Add a mutex function to see what thread owns a lock.
Less sure about this one, but it seems handy for debugging.
* See if we can make it so there is a thread per keyboard.
* (provide 'thread) at the right spot
* Some convenience macros, like 'with-mutex'
* Change gnus so 'g' runs in the background. Isn't that what this is
really all about?
The far-flung future, aka stuff I don't anticipate getting to:
* Redo the bindings code to be more efficient
* Change thread switching to happen more often, say every N calls to
QUIT.
* Eventually, remove the interpreter lock. I think the current design
still allows this (though some details in the current code would have
to be changed). This is very tricky though.
Tom