emacs-devel
[Top][All Lists]
Advanced

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

Re: threads and kill-buffer


From: Eli Zaretskii
Subject: Re: threads and kill-buffer
Date: Wed, 05 Sep 2012 19:35:35 +0300

> From: Sam Steingold <address@hidden>
> Date: Wed, 05 Sep 2012 10:20:47 -0400
> 
> > * Eli Zaretskii <address@hidden> [2012-09-05 05:53:56 +0300]:
> >
> > How about letting kill-buffer succeed, but delay the actual deletion
> > of the buffer until no thread has it as current, like what Posix
> > filesystems do with file deletion?
> 
> I am not sure that Posix file systems do this "by design" and not as a
> side effect of an implementation detail.

Why does it matter?  If we implement the same logic for buffers, it
will surely be by design.

> It is a certain way to lose data: imagine thread T1 moving data from
> buffer B1 to buffer B2 and thread T2 killing one of these buffers.
> Killing B1 is fine, but killing B2 will lose data. Note that being the
> current buffer of another thread is an insufficient protection because a
> thread may be writing to several buffers and only one of them may be
> current to it, so a thread should be able to mark a buffer as used by
> it, so that an attempt to kill a buffer used by a live thread would
> result in an exception.

That's an entirely different problem than the one that started this
thread.  The original problem was that each thread must have a current
buffer, and what to do when it is deleted by another thread.  That
problem is not about losing data at all, it's about gobs of Emacs
internals that assume there's always a current buffer that is a live
buffer.



reply via email to

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