unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Elias Mårtenson" <lokedhs@gmail.com>
Cc: raeburn@raeburn.org, tino.calancha@gmail.com, 25247@debbugs.gnu.org
Subject: bug#25247: 26.0.50; Concurrency crashes with XLib
Date: Fri, 30 Dec 2016 13:05:46 +0200	[thread overview]
Message-ID: <834m1lu16d.fsf@gnu.org> (raw)
In-Reply-To: <CADtN0WL-b=6aV_Xc0UcX=3TLgdEQ93xvzQp7kW5SjWxMQDqFEw@mail.gmail.com> (message from Elias Mårtenson on Fri, 30 Dec 2016 18:30:05 +0800)

> From: Elias Mårtenson <lokedhs@gmail.com>
> Date: Fri, 30 Dec 2016 18:30:05 +0800
> Cc: Tino Calancha <tino.calancha@gmail.com>, raeburn@raeburn.org, 25247@debbugs.gnu.org
> 
> The C-g issue is still gone.
> 
> As for the concurrency issues. I have been hammering this thing pretty
> hard, and no crashes so far.

Thanks, this is good news.

> I open IELM in one window, and an empty buffer "z" in another, and type the
> following:
> 
> (loop
>   repeat 10
>   do (make-thread (lambda ()
>                     (let ((n (random 10)))
>                       (with-current-buffer "z"
>                         (sleep-for n)
>                         (insert (format "Foo:%d\n" n)))))))
> 
> Here, I'd expect to see the "z" buffer being updated at the corresponding
> times. I.e. the message "Foo:4" should be displayed after 4 seconds. This
> is not what I see. Instead the messages appear in batches (i.e. several
> rows appearing at the same time).

And what do the messages that appear together say in the %d part?  Do
they all show the same value?

> The following seems to be a problem with lexically bound lambda functions
> used in a thread. The following example illustrates the problem:
> 
> (let ((x "test"))
>   (make-thread (lambda ()
>                  (with-current-buffer "z"
>                    (insert x)))))
> 
> I would expect this to insert "test" into the buffer, but instead nothing
> happens. Removing the reference to the variable "x" in the lambda makes it
> work.

Isn't the above expected?  If not, why not?

And what do you mean by "removing the reference"?





  reply	other threads:[~2016-12-30 11:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 10:20 bug#25247: 26.0.50; Concurrency crashes Tino Calancha
2016-12-22 17:28 ` Eli Zaretskii
2016-12-23  3:34   ` Tino Calancha
2016-12-23  8:34     ` Eli Zaretskii
2016-12-23 11:32       ` Tino Calancha
2016-12-23 14:14         ` Eli Zaretskii
2016-12-29 11:37           ` bug#25247: 26.0.50; Concurrency crashes with XLib Tino Calancha
2016-12-29 17:44             ` Eli Zaretskii
2016-12-30  3:13               ` Tino Calancha
2016-12-30  7:19             ` Ken Raeburn
2016-12-30  8:37               ` Eli Zaretskii
2016-12-30  9:41                 ` Eli Zaretskii
2016-12-30 10:30                   ` Elias Mårtenson
2016-12-30 11:05                     ` Eli Zaretskii [this message]
2016-12-30 11:21                       ` Elias Mårtenson
2016-12-30 18:54                         ` Eli Zaretskii
2016-12-30 20:40                           ` Eli Zaretskii
2016-12-31 11:05                         ` Eli Zaretskii
2016-12-31 15:34                           ` Elias Mårtenson
2016-12-31 15:51                             ` Eli Zaretskii
2016-12-31 16:24                               ` Elias Mårtenson
2016-12-31 17:18                                 ` Eli Zaretskii
2016-12-31 17:28                                   ` Elias Mårtenson
2016-12-31 18:06                                     ` Eli Zaretskii
2016-12-31 18:16                                       ` Elias Mårtenson
2016-12-31 18:29                                         ` Eli Zaretskii
2016-12-31 18:38                                           ` Eli Zaretskii
2016-12-30 13:45                   ` Tino Calancha
2016-12-30 16:57                     ` Eli Zaretskii
2017-01-06  0:03                       ` npostavs
2017-01-06  7:48                         ` Eli Zaretskii
2016-12-23  9:34   ` bug#25247: 26.0.50; Concurrency crashes Ken Raeburn
2016-12-23 10:04     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834m1lu16d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25247@debbugs.gnu.org \
    --cc=lokedhs@gmail.com \
    --cc=raeburn@raeburn.org \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).