From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Concurrency feature, sit-for doesn't work (crashing and unexpected behaviour) Date: Sun, 11 Dec 2016 15:12:16 +0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1085004895005435cb5cd X-Trace: blaine.gmane.org 1481440469 8436 195.159.176.226 (11 Dec 2016 07:14:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 07:14:29 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 08:14:26 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFyL1-0001CP-LN for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 08:14:23 +0100 Original-Received: from localhost ([::1]:54568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFyL5-0001cK-My for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 02:14:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFyKM-0001Ze-UD for emacs-devel@gnu.org; Sun, 11 Dec 2016 02:13:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFyKI-0007wD-Ue for emacs-devel@gnu.org; Sun, 11 Dec 2016 02:13:42 -0500 Original-Received: from mail-qt0-f177.google.com ([209.85.216.177]:34208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFyKI-0007uI-Pj for emacs-devel@gnu.org; Sun, 11 Dec 2016 02:13:38 -0500 Original-Received: by mail-qt0-f177.google.com with SMTP id n6so51868475qtd.1 for ; Sat, 10 Dec 2016 23:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=PWHJ/LxwMix0wqgT6Th30PSiVxWWBa14qQNecLP/Vcs=; b=d6seci+Pe25dO0PpI9O4Qx0KoYDLpAIguW3iYu3gFiYkivBLsJ1wsEWjejsV74aChX v2i/0uLcavyuwDI7BdUJfAAfL+obaGuOoEPZ0TE9V81zgy/aOAIDlWr2iVdVGB29m0hw 1CajUwRnT+oc++2SAYTf5B/L7MPTOU0s4+5ZIOPs2NWO4CgSGQf5g6ln5Q4Ib7uRrq2R NGTmkleZpO9lnPVb7WvHfRwOSRUKp7n5NaYxemoJzwrVDmQs54XLhRGdw/nlx+Z3tZcI psIQ0uQnmqJI4NzdSm+IJdJP2c/SlME0G0T2ODeWdYLFrFa6Dpx1PC0UQyhVQ8JQE6Zr 8jqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PWHJ/LxwMix0wqgT6Th30PSiVxWWBa14qQNecLP/Vcs=; b=HsLlwg45oCATLtJd2gmhPoXldl2HFJQiZT28Nsna/L/ubA6d0Igr/dy5fNVFg9mQOY fXwMtKSv5dypxQCIC+1sWOSxwYc0zZN15NmQgN94wugEIuKtyuhRrgeA+rGhF337eGkK DUIUW6jylFUvboXKZmGAdppKtVXLf91S6VBqCn8CiLP94gprDgl6zZc1W3/h9VblTPoR DfNsVidlSi57/p0zlemL0jKE2VYUW2FNU4IMFJy31GtYl0enXA+E66HU5Kq7nMEWowV/ xzN/N+6bR131BvM2f3sYZPNq2HTHCk2DtqDvDYkcsvtKsWEXSZT3+UotS6cjoqvLZgXP XLdQ== X-Gm-Message-State: AKaTC02sqCf1kSofG8b/HjAySoBehM0Czd4U7EE3d5Y0nQjEUuSLfnvpt5CKlS/K+NjiCnPNX35kZVQLcds64A== X-Received: by 10.200.49.165 with SMTP id h34mr73399578qte.43.1481440336576; Sat, 10 Dec 2016 23:12:16 -0800 (PST) Original-Received: by 10.55.110.5 with HTTP; Sat, 10 Dec 2016 23:12:16 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.216.177 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210257 Archived-At: --001a11c1085004895005435cb5cd Content-Type: text/plain; charset=UTF-8 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 --001a11c1085004895005435cb5cd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have been experimenting with the following code, ru= n from an IELM buffer:

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

I then keep the "z" bufer open in a different wi= ndow 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 exp= ect.

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

Also, = when the crash doesn't happen, and I keep pressing RET after running th= e above form, the insert will happen after much less than 5 seconds. Someti= mes 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
--001a11c1085004895005435cb5cd--