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: Stefan Monnier
Subject: Re: advice needed for multi-threading patch
Date: Wed, 26 Aug 2009 11:02:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> ... which brings me to my problem.  I'd also like to apply a similar
> treatment to buffer-local variables.  However, those do not have
> convenient accessor macros, and before starting the laborious task of
> wrapping all buffer field accesses, I thought I'd ask for advice.  Is
> this a sane way to proceed?  Should I do something different?  Could I
> get such a patch in before the rest of this work, just to make my local
> divergence smaller?

I'm not sure I understand what you want to do and which problem you want
to solve.  In my mind, in the first iteration of "adding multithreading
to Emacs", no buffer could have two active threads at the same time
(i.e. set-buffer would impose some kind of synchronization).  In such
a context, I think that buffer-local variables (and fields in the buffer
structures) don't need any special treatment, right?

> I'll also note that the above approach does not work for DEFVAR_INT.
> I have a plan for those but I fear it is somewhat expensive.  If you
> have an idea...

You can start with

  #define Vfoo XINT(*find_variable_location (&impl_Vfoo))

and then fix up all the cases where the variable in accessed as an lvalue.
In general, I'm not opposed to introducing macros for such accesses in
the trunk, if it can make such work easier.


        Stefan




reply via email to

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