emacs-devel
[Top][All Lists]
Advanced

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

Concurrency feature, sit-for doesn't work (crashing and unexpected behav


From: Elias Mårtenson
Subject: Concurrency feature, sit-for doesn't work (crashing and unexpected behaviour)
Date: Sun, 11 Dec 2016 15:12:16 +0800

I have been experimenting with the following code, run from an IELM buffer:

    (make-thread (lambda ()
        (sit-for 5)
        (with-current-buffer "z"
            (insert "foo"))))

I then keep the "z" bufer open in a different window so that I can see what is going on.

If I type this command and then wait 5 seconds, the buffer get updated just as I expect.

If I then type the same command again, Emacs crashes after 5 seconds. Sometimes I have to try more than twice to get Emacs to crash, but it will inevitably happen.

Also, when the crash doesn't happen, and I keep pressing RET after running the above form, the insert will happen after much less than 5 seconds. Sometimes it happens almost immediately. It's like sit-for actually doesn't wait the correct number of seconds, but rather will just finish as soon as control is returned to the thread.

Regards,
Elias

reply via email to

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