[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: YAMAMOTO Mitsuharu
Subject: Re: BLOCK_INPUT on Mac OS X
Date: Sat, 04 Sep 2004 18:07:28 +0900
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On 03 Sep 2004 12:48:19 -0400, Stefan Monnier <address@hidden> said:

> If you don't use SIGIO, I can't see how malloc/free could be
> interrupted.  What other signals are used?

SIGALRM, for polling input events periodically.  This is basically the
same way with what Emacs on Solaris is doing.

> Also, do a grep for "SYNC_INPUT", which is a compilation option I
> use to make the Xwindow code move most of the processing to outside
> of the signal handler (when compiled with SYNC_INPUT, the
> "interrupted malloc" should simply never be a problem and the
> BLOCK_INPUTS there are unnecessary).

Thanks for the info.  I was not aware of that.  It would be much
cleaner and safer than adding BLOCK_INPUT in an ad-hoc way.

I tried SYNC_INPUT with the X11 build on Mac OS X, which can use SIGIO
for notification of input events.  It worked fine, but I noticed that
we couldn't quit a synchronous subprocess if it produced no output.
For example, `M-! yes RET' can be quit but `M-! sleep 10 RET' cannot.

I also did some experiments with the Carbon build in conjunction with
the following patch so that malloc may not occur in an asynchronous
way also in ``SIGALRM systems''.  It seems to work fine as long as I
tested, except the synchronous process issue above.

                                     YAMAMOTO Mitsuharu

Index: src/keyboard.c
RCS file: /cvsroot/emacs/emacs/src/keyboard.c,v
retrieving revision 1.791
diff -c -r1.791 keyboard.c
*** src/keyboard.c      20 Aug 2004 10:34:12 -0000      1.791
--- src/keyboard.c      4 Sep 2004 08:49:50 -0000
*** 2097,2103 ****
--- 2097,2107 ----
       struct atimer *timer;
    if (poll_suppress_count == 0)
+ #ifdef SYNC_INPUT
+     interrupt_input_pending = 1;
+ #else
      poll_for_input_1 ();
+ #endif
  #endif /* POLL_FOR_INPUT */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]