[Top][All Lists]

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

Re: threads and kill-buffer

From: Stephen J. Turnbull
Subject: Re: threads and kill-buffer
Date: Thu, 06 Sep 2012 17:34:42 +0900

Tom Tromey writes:

 > Subtracting GC doesn't make sense, since we're only talking about Emacs
 > here.

Subtract GC from the scenario, not from Emacs.  With preemptive
threading (at the C level) the enlarge_buffer_text scenario doesn't
need a GC to occur.

 > But actually, even that is too strong.  I think the implementation
 > only has to be cooperative as far as the C code in Emacs is
 > concerned; and that it can appear to be preemptive from the Lisp VM
 > perspective.

But isn't that pretty horrible from the programmer's perspective?
There will be no obviously atomic operations except for variable
reference and null-ary function calls to primitives written in C.  Any
function that accepts list arguments and wants them to be consistent
is either going to have to copy it, or lock it (and ISTM that locking
a list means locking each cons), or assume that its data can be
changed out from under it at any time (setcar and setcdr, not to
mention nconc and friends).

reply via email to

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