emacs-devel
[Top][All Lists]
Advanced

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

Re: Concurrency via isolated process/thread


From: Eli Zaretskii
Subject: Re: Concurrency via isolated process/thread
Date: Mon, 24 Jul 2023 16:41:28 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> Date: Mon, 24 Jul 2023 13:15:55 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >   #define PT (current_buffer->pt + 0)
> >
> > automagically makes PT refer to the current buffer, so the code only
> > needs to change current_buffer to have PT set correctly.
> >
> > By contrast, you propose to have one value of point per thread, which
> > means a thread that switches buffers will have to manually change all
> > of these values, one by one.  Why is that a good idea?
> 
> Switching buffer already involves juggling with pt_marker_ in
> record_buffer_markers and fetch_buffer_markers.

No, it doesn't, not if the code only sets current_buffer.

> > And what about C code which copies/moves text between two buffers?
> > For example, some primitives in coding.c can decode text from one
> > buffer while writing the decoded text into another.
> 
> They still use set_buffer_internal.

That's not necessary for some operations.



reply via email to

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