emacs-devel
[Top][All Lists]
Advanced

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

Re: threads and kill-buffer


From: Tom Tromey
Subject: Re: threads and kill-buffer
Date: Wed, 05 Sep 2012 14:34:00 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

>>>>> "Stephen" == Stephen J Turnbull <address@hidden> writes:

Stephen> Eg, A starts writing to the buffer, B kills it, it gets GC'd
Stephen> and reallocated, this time for byte-code running in thread C,
Stephen> and A starts playing "core wars" with what it thinks is its
Stephen> current buffer.[2]

Stephen> [2]  Before the thread advocates start stoning me, let me acknowledge
Stephen> that this scenario is highly unlikely even in the worst case, and
Stephen> more or less impossible for the kinds of applications normally
Stephen> proposed for Emacs Lisp threads (eg, asynchronous I/O).  But it's at
Stephen> least theoretically possible with preemptive threads and Sufficiently
Stephen> Stupid Code[tm].

No, it really is impossible in the context of Emacs, even with
preemptive threads.  The impossibility lies in the "GCd and reallocated"
step.  If thread A has a handle on the buffer, then it cannot be GCd.

Tom



reply via email to

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