all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Concurrency feature, sit-for doesn't work (crashing and unexpected behaviour)
@ 2016-12-11  7:12 Elias Mårtenson
  2016-12-11  9:08 ` Simon Leinen
  0 siblings, 1 reply; 5+ messages in thread
From: Elias Mårtenson @ 2016-12-11  7:12 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1157 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-11 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-11  7:12 Concurrency feature, sit-for doesn't work (crashing and unexpected behaviour) Elias Mårtenson
2016-12-11  9:08 ` Simon Leinen
2016-12-11 14:38   ` Elias Mårtenson
2016-12-11 16:16   ` Eli Zaretskii
2016-12-11 16:40     ` Elias Mårtenson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.