[Top][All Lists]

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

Re: Patch for fields of `struct buffer'

From: Tom Tromey
Subject: Re: Patch for fields of `struct buffer'
Date: Mon, 31 Jan 2011 08:30:14 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

>>>>> "Stefan" == Stefan Monnier <address@hidden> writes:

>> (defvar var 0)
>> (let ((var 1))
>> (run-in-thread (lambda () (message "%d" var))))

Stefan> I think any choice is acceptable, from a semantics point of view.
Stefan> Maybe one of the two choices is "superior" in some sense, but it's not
Stefan> clear which, and I doubt it matters much.  So I think the option that
Stefan> leads to the cleaner code (ideally, both for the current code, and for
Stefan> any foreseeable alternative implementation we decide to use in some
Stefan> distant future) should be preferred.

Ok, thanks.

I will probably keep the current approach (the above shows "1"), since
the hair is all isolated in the thread-creation function, and since this
is how I expected it to work in the first place.

Another thing I realized I don't know is how thread-local let-bindings
ought to interact with lexbind.  That is, if you make a closure, and
then in the body of it you let-bind one of its captured variables, is
that let-binding thread-local?

Offhand I would say "yes", but presumably this implies a performance hit
where there was none before.


reply via email to

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