From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alain Schneble Newsgroups: gmane.emacs.devel Subject: Re: Asynchronous DNS Date: Tue, 9 Feb 2016 10:15:14 +0100 Message-ID: <86fux28ct9.fsf@realize.ch> References: <83oabzzsjq.fsf@gnu.org> <87fuxazkfe.fsf@gnus.org> <83io25yeqk.fsf@gnu.org> <87h9hpnreg.fsf@gnus.org> <83y4b0wi7m.fsf@gnu.org> <87si17evk6.fsf@gnus.org> <83twlnvcz2.fsf@gnu.org> <87vb63obm3.fsf@gnus.org> <87r3gqmg6g.fsf@gnus.org> <83egcqtfnm.fsf@gnu.org> <86mvrdmk8p.fsf@realize.ch> <877fihjo4m.fsf@gnus.org> <86io20n3xn.fsf@realize.ch> <8760y055l1.fsf@gnus.org> <86wpqfl8ly.fsf@realize.ch> <86si13l1nt.fsf@realize.ch> <87twliiumk.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455009382 12296 80.91.229.3 (9 Feb 2016 09:16:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 09:16:22 +0000 (UTC) Cc: Andreas Schwab , Eli Zaretskii , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 09 10:16:16 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 1aT4PA-0004WY-Dv for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 10:16:16 +0100 Original-Received: from localhost ([::1]:53431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT4P9-0002jI-Id for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 04:16:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT4Ov-0002iZ-Hw for emacs-devel@gnu.org; Tue, 09 Feb 2016 04:16:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT4Oq-0000Hg-DR for emacs-devel@gnu.org; Tue, 09 Feb 2016 04:16:01 -0500 Original-Received: from clientmail.realize.ch ([46.140.89.53]:2880) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aT4Oq-0000HU-1q; Tue, 09 Feb 2016 04:15:56 -0500 Original-Received: from rintintin.hq.realize.ch.lan.rit ([192.168.0.105]) by clientmail.realize.ch ; Tue, 9 Feb 2016 10:15:38 +0100 Original-Received: from MYNGB (192.168.250.224) by rintintin.hq.realize.ch.lan.rit (192.168.0.105) with Microsoft SMTP Server (TLS) id 15.0.516.32; Tue, 9 Feb 2016 10:15:13 +0100 In-Reply-To: <87twliiumk.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 09 Feb 2016 11:40:19 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) X-ClientProxiedBy: rintintin.hq.realize.ch.lan.rit (192.168.0.105) To rintintin.hq.realize.ch.lan.rit (192.168.0.105) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] X-Received-From: 46.140.89.53 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:199583 Archived-At: Lars Ingebrigtsen writes: > Andreas Schwab writes: > >> Alain Schneble writes: >> >>> True, but my assumption was that it would be illegal to call >>> `accept-process-output' say, for example, from within >>> `set-process-coding-system' for the sake of waiting for the DNS resolve >>> to complete as it might have unwanted side effects. >> >> You have to wait for the completion event in some way. > > Yeah, these blockers would basically have to be a version of this thing > from `send_process': > > while (! new_function_that_says_the_process_is_ready (proc)) > wait_reading_process_output (0, 20 * 1000 * 1000, 0, 0, Qnil, NULL, 0); > > I think. Which is what send_process does on EWOULDBLOCK. Ok, now I see, thanks to both of you. In the example above, wait_proc is NULL. Shall it be set to the process to wait for in a "real" implementation? Together with passing a sigevent struct to getaddrinfo_a, so the process gets signaled? Currently, this signaling is not used, as it polls for completion. I hope I'm not mixing things up...