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 15:44:24 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> Date: Mon, 24 Jul 2023 08:42:52 +0000
> 
> Ihor Radchenko <yantar92@posteo.net> writes:
> 
> > 3. Current buffer, point position, and narrowing.
> >
> >    By current design, Emacs always have a single global current buffer,
> >    current point position, and narrowing state in that buffer.
> >    Even when we switch cooperative threads, a thread must update its
> >    thread->current_buffer to previous_thread->current_buffer; and update
> >    point and narrowing by calling set_buffer_internal_2.
> >
> >    Current design is incompatible with async threads - they must be able
> >    to have different buffers, points, and narrowing states current
> >    within each thread.
> >
> >    That's why I suggested to convert PT, BEGV, and ZV into
> >    thread-locals.
> 
> Would it be acceptable to convert buffer PT, BEGV, and ZV into
> thread-local for current cooperative threads?

General note: it is very hard to have a serious discussion of this
kind of subject when the goals are not clearly announced, and there
are gaps of week or two between messages.  Discussing several separate
aspects of this makes this even harder to follow and respond in a
useful manner.

> I am thinking about:
> 
> 1. Removing pt, pt_byte, begv, begv_byte, zv, zv_byte, pt_marker_,
>    begv_marker_, and zv_marker_ from buffer objects.
> 2. Adding pt/begv/zv to thread object.
> 3. Adding an alist linking buffers and past
>    pt/begv/zv positions visited by a given thread.
> 
> This way, when a thread yields and later continues executing, its point
> and restriction will not be changed.

Why is the last sentence a worthy goal? what do you think will be the
advantage of that?



reply via email to

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