From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] system-type cygwin with window-system w32 Date: Mon, 18 Jul 2011 10:50:37 -0700 Message-ID: <4E24726D.1080609@gmail.com> References: 4E240C17.4020102@gmail.com <4E246E75.6040807@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7B7F7A9AEB32DC1E2FD664F7" X-Trace: dough.gmane.org 1311011696 13869 80.91.229.12 (18 Jul 2011 17:54:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 17:54:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: grischka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 19:54:46 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 1Qis1l-0000P4-BV for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 19:54:45 +0200 Original-Received: from localhost ([::1]:59432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qis1j-0005dB-KV for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 13:54:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qiry4-0004fs-Vk for emacs-devel@gnu.org; Mon, 18 Jul 2011 13:51:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qirxu-0006RE-GT for emacs-devel@gnu.org; Mon, 18 Jul 2011 13:50:51 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:36347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qirxu-0006Qp-5V for emacs-devel@gnu.org; Mon, 18 Jul 2011 13:50:46 -0400 Original-Received: by iyb14 with SMTP id 14so2351883iyb.0 for ; Mon, 18 Jul 2011 10:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; bh=aKk5FHGqpyKZfPDilipDV/PC60wkNo+YXX0B9thbA7k=; b=Fqnkxy+cqSe1l0g5oLndOohfzRsJygAh2getDGNo4MKurRkcpaolbvq/f1WUcsw2VB xld6PcaO7pSQJzNmtUkM6SrO5/j/VCx8VWOXCxPidz7mYznk38VVgnGUtczsG7EH1zAF erROK6HmNqMPDu5S5QqnzcsMVpATvelxI4YFA= Original-Received: by 10.42.246.8 with SMTP id lw8mr7543908icb.339.1311011444798; Mon, 18 Jul 2011 10:50:44 -0700 (PDT) Original-Received: from [192.168.1.2] (c-24-18-179-193.hsd1.wa.comcast.net [24.18.179.193]) by mx.google.com with ESMTPS id o1sm5169132ict.8.2011.07.18.10.50.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jul 2011 10:50:44 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: <4E246E75.6040807@gmx.de> X-Enigmail-Version: 1.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 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:142124 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7B7F7A9AEB32DC1E2FD664F7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/18/11 10:33 AM, grischka wrote: > Daniel Colascione wrote: >> I'll have to add a comment explaining what's going on here. In the >> meantime: the main thread doesn't usually pump messages because it's >> blocked on select(2) instead. =20 >=20 > Doesn't cygwin have a pseudo device /dev/windows to select for > incoming WM_xxx messages? >=20 > --- grischka Wow. Thanks for the tip. /dev/windows doesn't appear to be well-documen= ted externally, but from fhandler_windows.cc in the Cygwin tree: /* The following unix-style calls are supported: open ("/dev/windows", flags, mode=3D0) - create a unix fd for message queue. read (fd, buf, len) - return next message from queue. buf must point to MSG structure, len must be >=3D sizeof (MSG). If read is set to non-blocking and the queue is empty, read call returns -1 immediately with errno set to EAGAIN, otherwise it blocks untill the message will be received. write (fd, buf, len) - send a message pointed by buf. len argument ignored. ioctl (fd, command, *param) - control read()/write() behavior. ioctl (fd, WINDOWS_POST, NULL): write() will PostMessage(); ioctl (fd, WINDOWS_SEND, NULL): write() will SendMessage(); ioctl (fd, WINDOWS_HWND, &hWnd): read() messages for hWnd window. select () call marks read fd when any message posted to queue. */ If it works, /dev/windows would allow us to get rid of not only the self-= pipe and the clipboard thread, but the UI thread as well, though it'd be easie= r to keep the last of these for compatibility for the NT build. Thanks. By the way: why do we use a separate UI thread in the NT case at all? AI= UI, we can do everything we need asynchronously via overlapped IO, so we should = never have to block and not pump messages. --------------enig7B7F7A9AEB32DC1E2FD664F7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk4kcnEACgkQ17c2LVA10VtRJQCcCF2zrc0LqGqlQB3G/1KDaUnJ 47sAoNWJqcRymMLYxCPAplHvL7G4cw7G =le/b -----END PGP SIGNATURE----- --------------enig7B7F7A9AEB32DC1E2FD664F7--