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: Ihor Radchenko
Subject: Re: Concurrency via isolated process/thread
Date: Fri, 07 Jul 2023 12:42:40 +0000

Po Lu <luangruo@yahoo.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Same with variables - even if some global variable needs to be locked,
>> it is unlikely that it will need to be accessed by another thread.
>
> I doubt symbol value cells will need to be individually interlocked.
> Emacs Lisp code will need to insert the appropriate instructions to
> prevent the CPU from undertaking optimizations on load and store
> operations on those cells when necessary. ...

I had a different simple scenario in mind:

(let ((oldval case-fold-search))
  (unwind-protect
    (progn (setq case-fold-search nil)
      ;; We surely do not want the value of `case-fold-search' to be
      ;; changed in the middle of `expensive-computation'.
      (expensive-computation))
    (setq case-fold-search oldval))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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