From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: grischka Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] system-type cygwin with window-system w32 Date: Mon, 18 Jul 2011 23:01:43 +0200 Message-ID: <4E249F37.3050101@gmx.de> References: 4E240C17.4020102@gmail.com <4E246E75.6040807@gmx.de> <4E24726D.1080609@gmail.com> <4E2476BA.40201@gmail.com> <4E2480E6.5040306@gmx.de> <4E24855D.5030607@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050702040608000808070203" X-Trace: dough.gmane.org 1311023072 21902 80.91.229.12 (18 Jul 2011 21:04:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 21:04:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 23:04:28 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QiuzL-0001RF-1F for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 23:04:27 +0200 Original-Received: from localhost ([::1]:43470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiuzK-0005kb-4b for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 17:04:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qiux7-0005Jv-Uz for emacs-devel@gnu.org; Mon, 18 Jul 2011 17:02:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qiux3-0006nC-Hy for emacs-devel@gnu.org; Mon, 18 Jul 2011 17:02:09 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:40468) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Qiux2-0006mO-D1 for emacs-devel@gnu.org; Mon, 18 Jul 2011 17:02:05 -0400 Original-Received: (qmail invoked by alias); 18 Jul 2011 21:02:01 -0000 Original-Received: from unknown (EHLO [10.131.50.209]) [89.204.154.209] by mail.gmx.net (mp014) with SMTP; 18 Jul 2011 23:02:01 +0200 X-Authenticated: #18588216 X-Provags-ID: V01U2FsdGVkX1+HlmsZfGKHEiAIKyOBioEgBs7dDMDcoRYF4weaeL WiHEtIIfGJB7ZZ User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) In-Reply-To: <4E24855D.5030607@gmail.com> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142138 Archived-At: This is a multi-part message in MIME format. --------------050702040608000808070203 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Daniel Colascione wrote: >> Actually the NT build works quite well with one single thread. >> Already tested here. > > Do you have a patch handy? Attached. Patch was against state at commit: Jan D. 2011-02-01 09:53:03 Use add/delete_read_fd in xsmfns to simplify. Also ... Hopefully still applies cleanly. It is minimal, and maybe not quite obvious. Basically the two window message switches (w32fns.c and w32term.c) could be merged into one. The patch calls the one from the other. There is an elisp variable 'w32-single-thread' which should return 1 if you want to make sure you're using the right build. :) Note that you can for example drag the "Open File" dialog across the main window and it still gets redrawn. >> * peek for messages in the QUIT macro (say via ELSE_PENDING_SIGNALS) >> which is for C-g to interrupt lisp. > > I don't think this approach alone would be sufficient. I may be wrong, > but I think the Windows window manager will consider a program to be > "unresponsive" if it stops actually pumping messages; I don't think > peeking is sufficient. Also, [1] says that we shouldn't delay pumping > messages even if we're able to guarantee we'll get around to them later. > (Running lisp code is indistinguishable from sleep in this case.) > Using PeekMessage in lisp code instead of actually pumping messages > would be like telling your credit card company, "Yeah, I got the bill, > and I'll get around to responding sometime in the next two years". I > don't think it'd go over well. "Two years" or anyway "indistinguishable from sleep" is never really acceptable. Because then emacs can't process key/mouse events regardless how many threads you have in the backend. We need to think in terms of UI timings here. Reference is the kbd repeat rate, say 30ms, which is also in the range of eye perception capability and frame repeat rates. Up to this is smooth. More can be tolerable though, even up to 1 or more seconds. Say for popping up new windows, frames, etc. So if your elisp doesn't finish in 30ms, you know ;) >> * break command_loop_1() such that it can be used to handle just one >> event which is to handle scrollbar messages because the widgets >> run their own message loop deep in windows. Otherwise all the >> scrolling would happen only after you release the mouse button. > > I doubt that the scrollbar is the only special case we'd need to consider. AFAICS scrollbar and paint. And maybe clipboard rendering. Emacs handles paint directly via expose_frame() though, not via the event queue. > I don't understand how this approach helps. The problem, AIUI, isn't > that we have Lisp events, but that we read input and wait for processes > in many places, and it's hard to be confident that each place we pump > messages is a safe place to process lisp code. I don't understand how > draining the lisp event queue would help. As I see it this is just recursion. Such things happen all the time in all GUIs that use callbacks. Windows, GTK, whatever. It happens in emacs already: (run-with-idle-timer ... lisp-code) --- grischka --------------050702040608000808070203 Content-Type: text/plain; name="gr-w32-singlethread.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="gr-w32-singlethread.patch" ZGlmZiAtLWdpdCBhL250L2NvbmZpZy5udCBiL250L2NvbmZpZy5udAppbmRleCBkNjEyYTQx Li5kZDRjZDM4IDEwMDY0NAotLS0gYS9udC9jb25maWcubnQKKysrIGIvbnQvY29uZmlnLm50 CkBAIC00NjcsNiArNDY3LDggQEAgZXh0ZXJuIGNoYXIgKmdldGVudiAoKTsKICNlbmRpZgog I2VuZGlmCiAKKyNkZWZpbmUgU0lOR0xFX1RIUkVBRAorCi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