unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 25214@debbugs.gnu.org, tom@tromey.com
Subject: bug#25214: 26.0.50; Interacting with user from threads other than the primary
Date: Tue, 18 Sep 2018 10:29:25 +0200	[thread overview]
Message-ID: <875zz3mcnu.fsf@gmx.de> (raw)
In-Reply-To: <83efdsgcqv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 17 Sep 2018 22:11:52 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> So what means do we have to interrupt a pselect call from another
>> thread?
>
> One simple idea is not to interrupt a pselect call, but instead to
> make sure the main thread never waits for too long for pselect to
> return.  We could arrange for acquire_global_lock to maintain a count
> of the number of threads that are waiting to take the lock, and if
> that number is positive, reduce the timeout we pass to pselect such
> that it never waits for more than, say, 1 sec.  Then we need a way for
> a non-main thread to wait until the main thread returns from pselect,
> at which time the non-main thread could proceed with its own attempt
> to read input, while the main thread is stuck waiting for the global
> lock.

I'll see whether I could implement something along this idea. But I'm
still learning Emacs' keyboard (more general: FD) handling, so it will
take time.

For waiting of the non-main thread: maybe a mutex and/or condition
variable could do the job.

Best regards, Michael.





  reply	other threads:[~2018-09-18  8:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 15:17 bug#25214: 26.0.50; Interacting with user from threads other than the primary Eli Zaretskii
2016-12-19  4:31 ` Clément Pit--Claudel
2018-09-17 14:06 ` Michael Albinus
2018-09-17 18:41   ` Eli Zaretskii
2018-09-17 19:11     ` Eli Zaretskii
2018-09-18  8:29       ` Michael Albinus [this message]
2018-09-18  8:34         ` Eli Zaretskii
2018-09-27 16:15           ` Michael Albinus
2018-09-27 16:20             ` Eli Zaretskii
2018-09-28 11:09               ` Michael Albinus
2018-09-18  8:21     ` Michael Albinus
2018-09-18 12:33       ` Eli Zaretskii
2019-02-06  6:58 ` bug#25214: #25214 " Zhang Haijun
2019-02-06 15:41   ` Eli Zaretskii
2019-02-07  1:39     ` Zhang Haijun
2019-02-07 14:29       ` Eli Zaretskii
2019-02-07 14:56         ` Zhang Haijun
2019-02-07 17:25           ` Eli Zaretskii
2019-02-08  2:42             ` Zhang Haijun
     [not found]     ` <D55AF9DD-D8D2-4A59-AE6D-24B597A164C1@outlook.com>
2019-02-07 13:49       ` Zhang Haijun

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=875zz3mcnu.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=25214@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=tom@tromey.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).