On 1/31/11 11:04 AM, Tom Tromey wrote: > Other ideas I have been considering: > > Instead of explicit locks, just let any symbol function as a lock, and > have the locks hidden in the C code. While elegant, I'm afraid using symbols as locks would lead to a proliferation of locks of code, not data. Using a symbol as a big global lock is easier than using gensym to get per-object locks. > (Or an extension of this idea, let > any Lisp object be a lock -- "Java style".) This approach has potential. I believe JVMs get away with this trick at a cost of a machine word per object --- that's a big addition to a simple cons cell, of which Emacs has quite a few. > Or, instead of the locks-and-condition-variables approach, go the CSP > route and have channels and channel-select. This idea is making a > comeback, maybe it would fit well in Emacs Lisp. Some sort of CSP facility would be interesting. I'd also love to see Clojure-style STM, although I don't know how well something like an agent would work in elisp's more imperative environment. Also, it'd require lexbind to make sense at all.