From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: Asynchronous DNS Date: Tue, 26 Jan 2016 01:15:56 +0800 Message-ID: References: <83lh7d3bel.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1143026ecf66e3052a2bb84d X-Trace: ger.gmane.org 1453742166 2418 80.91.229.3 (25 Jan 2016 17:16:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2016 17:16:06 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 25 18:16:06 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aNkkG-0002rp-0s for ged-emacs-devel@m.gmane.org; Mon, 25 Jan 2016 18:16:04 +0100 Original-Received: from localhost ([::1]:39940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNkkE-0004dI-TZ for ged-emacs-devel@m.gmane.org; Mon, 25 Jan 2016 12:16:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNkkB-0004d6-2f for emacs-devel@gnu.org; Mon, 25 Jan 2016 12:15:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNkkA-0004B9-2p for emacs-devel@gnu.org; Mon, 25 Jan 2016 12:15:59 -0500 Original-Received: from mail-vk0-x236.google.com ([2607:f8b0:400c:c05::236]:36136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNkk8-0004AM-Iy; Mon, 25 Jan 2016 12:15:56 -0500 Original-Received: by mail-vk0-x236.google.com with SMTP id n1so77337004vkb.3; Mon, 25 Jan 2016 09:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AVcR7sWDb0Hc6WU3qvh03ZnhATWIfLC9RJgMca+A3WM=; b=PYYn+FZpOdSEDtaf6Z9uab4bXfh6ylJe1+5Uog3Eiydcf+sTeCX8E+MeuvsYIcgfVh gMR72wXg/G8WNgC9eSWBElTITVccG9nNdeNNuAPYmDtl2Dh/9P42yqZFnYTtBvU5nXrv oB/k29d5rXWCSbtvQRDR2nCaNwOCML24q8I3brnLNRt47fjpNi9ZvdXbvxo7SLNlMVyU 4O1TgjmI3V2gjU4tGnGHdm6U0xmt8itAglZ9JOgfgnMQAi2z+XrnDnangZC9XLik+s9v u0lztuyQw4MCsk3HciT5NVyDltzFf+MhwAnkLHdEe1IVc8F5oaMXnkwmjum4L6gKXlug TmOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=AVcR7sWDb0Hc6WU3qvh03ZnhATWIfLC9RJgMca+A3WM=; b=U1FCUVOkBSUbEoA1q/rg2p3cngRyvHU5jXH1fqKOjKf6TuQyCt+OIRbWJtUm4GgYVG t4ZNN1RRCRwxiSpl4gt82xc3+2HwUYYGscltlEUVtyV1hUvKo6F9JubqWAGXwdZkxL+b KhOKLDavHaNsnqgwXKZdiohbio4rxopeCjEIodxVvCSdAKyVOYQhu+wt/w8O+0ycqqTm SjFWdmehu+WV0JrvU6Y7VkP2rz74KBR1oq3NtPfylFXB1MSMvqoA/1Kq9aDNfUZY1P3R bqQYGNsggjMlcBo5QBO+goG3stb2FR42nlDgKdzxM3fi+CY7o7EMGTwDZB+rlLZGyNOh cK1g== X-Gm-Message-State: AG10YOTYXM0csbj0CLNPUB6mLobA2Cjeo/AcxLCaThitbarnuSqKXI4QCRiYwCm/1TJY3+OWJolhWmIrI603gA== X-Received: by 10.31.188.142 with SMTP id m136mr11433433vkf.89.1453742156111; Mon, 25 Jan 2016 09:15:56 -0800 (PST) Original-Received: by 10.103.80.28 with HTTP; Mon, 25 Jan 2016 09:15:56 -0800 (PST) Original-Received: by 10.103.80.28 with HTTP; Mon, 25 Jan 2016 09:15:56 -0800 (PST) In-Reply-To: <83lh7d3bel.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::236 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:198798 Archived-At: --001a1143026ecf66e3052a2bb84d Content-Type: text/plain; charset=UTF-8 On 25 Jan 2016 23:51, "Eli Zaretskii" wrote: > > The challenge with this scheme is to come up with the way to add an > event to the Emacs event queue from another thread. Once the event is > in the queue, all the rest is simple. However, the event queue is not > currently designed to accept events from other threads. > > Maybe you should take a look at the concurrency branch. I did something similar in a different project, and I solved that by creating a pipe so that the main thread's event handler (which was blocking on a select() call) could be notified that the worker thread wanted to send a message to the main loop. Isn't Emacs doing something similar, and if so, couldn't the same mechanism be used? Regards, Elias --001a1143026ecf66e3052a2bb84d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 25 Jan 2016 23:51, "Eli Zaretskii" <eliz@gnu.org> wrote:
>
> The challenge with this scheme is to come up with the way to add an > event to the Emacs event queue from another thread.=C2=A0 Once the eve= nt is
> in the queue, all the rest is simple.=C2=A0 However, the event queue i= s not
> currently designed to accept events from other threads.
>
> Maybe you should take a look at the concurrency branch.

I did something similar in a different project, and I solved= that by creating a pipe so that the main thread's event handler (which= was blocking on a select() call) could be notified that the worker thread = wanted to send a message to the main loop.

Isn't Emacs doing something similar, and if so, couldn&#= 39;t the same mechanism be used?

Regards,
Elias

--001a1143026ecf66e3052a2bb84d--