emacs-devel
[Top][All Lists]
Advanced

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

Re: Blocking calls and threads


From: Eli Zaretskii
Subject: Re: Blocking calls and threads
Date: Thu, 20 Apr 2023 10:23:46 +0300

> From: Lynn Winebarger <owinebar@gmail.com>
> Date: Thu, 20 Apr 2023 01:31:14 -0400
> 
> The thread on how to make asynchronous behavior explicit made me
> curious whether making a blocking system call would cause the lisp
> thread to yield to other lisp threads (release the global lock).  Do
> blocking system calls yield the lisp thread, or is there any way in
> lisp code to call blocking functions so that the lisp thread will
> yield while the system thread blocks?

What do you mean by "blocking system calls", exactly?

If you mean the likes of 'read' and 'write' (i.e. "blocking system
calls" on the OS level), then no, a thread which makes these calls
will not yield.  How can it? the implementation of those calls is not
in Emacs, so how can Emacs change the way these syscalls work?

The "blocking system calls" which do yield are calls emitted from
Lisp: accept-process-output, sit-for, read-key-sequence, etc.



reply via email to

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