all messages for Emacs-related lists mirrored at yhetil.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: Sat, 31 Dec 2016 20:29:48 +0200	[thread overview]
Message-ID: <83eg0ogder.fsf@gnu.org> (raw)
In-Reply-To: <CADtN0WKE6qQZY30wZNpUdLiB+bvOeyUWPZ74TbMMyL-BH-T64w@mail.gmail.com> (message from Elias Mårtenson on Sun, 1 Jan 2017 02:16:41 +0800)

> From: Elias Mårtenson <lokedhs@gmail.com>
> Date: Sun, 1 Jan 2017 02:16:41 +0800
> Cc: Tino Calancha <tino.calancha@gmail.com>, raeburn@raeburn.org, 25247@debbugs.gnu.org
> 
>  "Ready to run" means here a thread that is stuck in
>  acquire_global_lock. One of those threads will succeed in acquiring
>  the lock when the thread which was previously running releases the
>  lock.
> 
> In this case, the thread died, and all other threads are idle. Wouldn't this trigger a redisplay?

When a thread dies, the global local is released, so some other thread
that waits for the lock can run.  But I don't think that should
trigger redisplay, because it means Emacs isn't idle.

I don't understand what you mean by "all other threads are idle".  I
don't think any of them are, but I'm not sure we have the same idea of
"idle" in this context.  For me, "idle" means a thread that waited for
input and didn't get any until its wait timeout expired.  Only after
that we say that Emacs is "idling".

>  Those which are still waiting for their sleep period to expire will
>  not run, because they are inside the pselect call. Only the threads
>  whose sleep period already expired are "ready to run", because they
>  call acquire_global_lock right after the pselect call returns.
> 
> But the way I interpreted what you were saying was that if there are no threads that are "ready to run" (as in
> this case), redisplay would be called.

Yes, but only after the main thread ends its waiting timeout.  That is
why having timers produces more frequent redisplay.

> If that was indeed what you were saying, then that doesn't match observed behaviour. If I misunderstood what
> you were saying, then things make sense.
> 
> I'm willing to bet that the latter is true.

I'm not sure, because I don't understand what exactly doesn't match
the observations.

>  It's perfectly normal for Emacs not to redisplay when some Lisp is
>  running. That is what happens here, except that "some Lisp" in this
>  case can come from another thread.
> 
> Fair enough. I guess the introduction of threads will make the redisplay function more important than it has
> been in the past.

Only if the non-main threads must produce some visible effect.  That's
not a given; they could instead do some background job that doesn't
directly affect the displayed text.





  reply	other threads:[~2016-12-31 18:29 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=83eg0ogder.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 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.