all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Raeburn <raeburn@raeburn.org>
To: Tom Tromey <tromey@redhat.com>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: advice needed for multi-threading patch
Date: Wed, 26 Aug 2009 03:06:38 -0400	[thread overview]
Message-ID: <B512513D-5F4A-43A7-BE6F-57B38331992E@raeburn.org> (raw)
In-Reply-To: <m3eiqz2nqm.fsf@fleche.redhat.com>

On Aug 26, 2009, at 00:38, Tom Tromey wrote:
> In particular I've (initially) implemented cooperative multi- 
> threading.

Interesting!

(BTW, my guile-emacs work is also coming along slowly [1], and Guile  
supports multithreading, though my current variable-binding support  
isn't thread-safe.  OTOH, Daniel Kraft has been working on loading/ 
compiling basic elisp in Guile, with thread-safe dynamic bindings.   
We've got some work to do to make these development projects converge  
though.  I hope you and Daniel and I aren't doing redundant work.)

> I managed to handle the V* global variables by writing some elisp that
> changed every declaration of a variable mentioned in a DEFVAR_LISP  
> [....]

I've written similar elisp code for doing transformations of patterns  
within the Emacs code -- mostly more localized things like "XCONS  
(expr)->car" to "XCAR (expr)", but with support for somewhat complex  
values of "expr" that have to have balanced parens, etc.  I wonder if  
anyone's looking at collecting elisp tools for C refactoring somewhere.

> This was pretty simple and non-intrusive, in the sense that it is
> totally automated, so I can easily reapply it as Emacs changes.

Same here.  It can *look* very intrusive, even pervasive, when the  
uses are scattered around the source tree, but simple transforms like  
this aren't as scary as they might look to someone who doesn't  
recognize what's happening.

> ... 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?

Should I take this to mean you've already dealt with the buffer-local  
variables created by make-variable-buffer-local, which don't live in  
the buffer structure?  If so, I wonder if you can make use of those  
changes, by replacing XBUFFER(b)->thing with SYMBOL_VALUE(Qthing)  
where Qthing holds a symbol that's marked as buffer-local; then all  
the changes for the interaction between thread-local and buffer-local  
bindings would be localized in indirect_variable and friends, which  
would then have to deal with both Lisp_Misc_Buffer_Objfwd and  
Lisp_Misc_Buffer_Local_Value.  The Guile work I'm doing would also  
probably benefit from such changes, down the road.

(One change I'm looking at in my Guile work is changing  
indirect_variable to accept and return Lisp_Objects instead of struct  
Lisp_Symbol pointers, for better GC safety.  I doubt such a change  
would significantly affect your work, though it may touch on  
overlapping bits of code.)

Ken

[1] http://lists.gnu.org/archive/html/guile-devel/2009-08/ 
msg00163.html ; I also have a sort of "project page" I wrote up a  
while back, but it's not quite current.




  reply	other threads:[~2009-08-26  7:06 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26  4:38 advice needed for multi-threading patch Tom Tromey
2009-08-26  7:06 ` Ken Raeburn [this message]
2009-08-26 14:52   ` Stefan Monnier
2009-08-26 18:50     ` Ken Raeburn
2009-08-27  3:12       ` Stefan Monnier
2009-08-27  6:28         ` Ken Raeburn
2009-08-27 17:02           ` Stefan Monnier
2009-08-26 16:08   ` Tom Tromey
2009-08-26 18:50     ` Ken Raeburn
2009-08-27  5:07       ` Miles Bader
2009-08-27  6:39         ` Ken Raeburn
2009-08-27  6:50           ` Miles Bader
2009-08-28 20:48             ` Juri Linkov
2009-08-28 22:15               ` Miles Bader
2009-08-28 23:27                 ` Juri Linkov
2009-08-28 23:54                   ` Miles Bader
2009-08-29 20:21                 ` Richard Stallman
2009-08-26 15:02 ` Stefan Monnier
2009-08-26 15:31   ` Tom Tromey
2009-08-26 19:18     ` Stefan Monnier
2009-09-18 22:59       ` Tom Tromey
2009-09-19  0:09         ` Stephen J. Turnbull
2009-09-19  0:32         ` Chong Yidong
2009-09-21 21:19         ` Stefan Monnier
2009-09-21 21:50           ` Tom Tromey
2009-09-22 14:24             ` Stefan Monnier
2009-09-22 23:59               ` Ken Raeburn
2009-09-23  3:11                 ` Stefan Monnier
2009-09-23 15:53                 ` Chong Yidong
2009-09-23  3:16               ` Tom Tromey
2009-09-24 17:25                 ` Stefan Monnier
2009-09-24 17:57                   ` Tom Tromey
2009-09-27 20:59                   ` Tom Tromey
2009-09-27 23:05                     ` Stefan Monnier
2009-09-28  4:27                       ` Tom Tromey
2009-09-29  0:27                         ` Stefan Monnier
2009-09-29  2:26                           ` Ken Raeburn
2009-09-29  3:20                             ` Stefan Monnier
2009-09-29  3:57                               ` Ken Raeburn
2009-09-29  3:33                             ` Tom Tromey
2009-09-29  4:07                               ` Ken Raeburn
2009-09-29  2:30                           ` Tom Tromey
2009-09-23 18:43               ` Giuseppe Scrivano
2009-09-24 17:29                 ` Stefan Monnier
2009-09-24 18:53                   ` Giuseppe Scrivano
2009-09-24 20:04                     ` Tom Tromey
2009-09-24 21:59                       ` Stefan Monnier
2009-09-24 22:23                       ` Giuseppe Scrivano
2009-09-24 22:47                       ` Ken Raeburn
2009-09-28 14:52                       ` Ted Zlatanov
2009-10-05  6:02                       ` joakim
2009-09-28  7:44               ` Lynbech Christian
2009-08-29  0:28 ` Giuseppe Scrivano
2009-08-29  4:57   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B512513D-5F4A-43A7-BE6F-57B38331992E@raeburn.org \
    --to=raeburn@raeburn.org \
    --cc=emacs-devel@gnu.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.