From: "Jan D." <jan.h.d@swipnet.se>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Core dumps in redisplay.
Date: Fri, 4 Mar 2005 19:54:16 +0100 [thread overview]
Message-ID: <5fc6e1563cda9518e92ea2832556bf46@swipnet.se> (raw)
In-Reply-To: <E1D5mCk-00040t-9g@fencepost.gnu.org>
2005-02-28 kl. 15.49 skrev Richard Stallman:
> This sounds like normally only the main thread should ever be
> touching
> interrupt_input_blocked, unless we have a bug. Correct? So we
> need
> not think about how to synchronize accesses to the variable, but
> rather make sure that no thread except the main thread will ever
> run
> code touching it. Correct?
>
> That is one coherent design plan. It may not be the only one.
>
> Meanwhile, operations carried out in another thread are somewhat like
> operations carried out in a signal handler. So in some cases it may
> be necessary for other threads to wait for interrupt_input_blocked to
> be 0 before they do their work.
I think this is only needed if the other threads will be executing
Emacs code. For the case at hand (the Gnome file chooser backend),
this is the case only for malloc and friends because Emacs inserts it
hooks for malloc etc.
>
> And unless those threads have strictly higher priority than the main
> thread, we have to worry about locking: how to prevent the main thread
> from continuing and entering code that does BLOCK_INPUT while the
> other thread is doing something that's supposed to be blocked by
> BLOCK_INPUT.
Signal handling with multiple threads is not portable and very tricky.
If we could minimize the work done in signal handlers, preferrably just
setting a variable or two, thing would be simpler.
But a mutex lock/unlock in BLOCK/UNBLOCK_INPUT is the obvious initial
approach.
Jan D.
next prev parent reply other threads:[~2005-03-04 18:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-26 13:40 Core dumps in redisplay David Kastrup
2005-02-27 13:43 ` Richard Stallman
2005-02-27 18:56 ` David Kastrup
2005-02-27 20:08 ` Jan D.
2005-02-27 20:21 ` David Kastrup
2005-02-27 20:35 ` Jan D.
2005-02-27 21:28 ` David Kastrup
2005-02-27 22:08 ` Kim F. Storm
2005-02-28 5:34 ` Jan D.
2005-02-28 10:38 ` David Kastrup
2005-02-28 17:15 ` Jan D.
2005-02-28 17:46 ` David Kastrup
2005-02-28 19:09 ` Jan D.
2005-02-28 19:38 ` David Kastrup
2005-02-28 20:05 ` Jan D.
2005-02-28 20:29 ` David Kastrup
2005-02-28 17:14 ` David Kastrup
2005-02-28 14:49 ` Richard Stallman
2005-03-04 18:54 ` Jan D. [this message]
2005-02-27 21:51 ` Stefan Monnier
2005-02-27 22:36 ` David Kastrup
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=5fc6e1563cda9518e92ea2832556bf46@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=emacs-devel@gnu.org \
/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).