From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Async DNS lookups Date: Tue, 02 Nov 2010 17:28:13 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1288733310 24123 80.91.229.12 (2 Nov 2010 21:28:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Nov 2010 21:28:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 02 22:28:26 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PDOP1-0006ds-JF for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2010 22:28:23 +0100 Original-Received: from localhost ([127.0.0.1]:55197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDOP1-0002Ob-1E for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2010 17:28:23 -0400 Original-Received: from [140.186.70.92] (port=33772 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDOOu-0002NY-HK for emacs-devel@gnu.org; Tue, 02 Nov 2010 17:28:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDOOt-0003nq-Fo for emacs-devel@gnu.org; Tue, 02 Nov 2010 17:28:16 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:33752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDOOt-0003nd-9K for emacs-devel@gnu.org; Tue, 02 Nov 2010 17:28:15 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oA2LSDao007655; Tue, 2 Nov 2010 17:28:13 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 2D3DEB40E9; Tue, 2 Nov 2010 17:28:13 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 02 Nov 2010 19:13:30 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3667=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132303 Archived-At: > 3) When getaddrinfo() returns, we do > (funcall #'my-callback result my-data) > But 3) probably needs to be in the same sort of state that timers run > in, so that we don't have two Emacs Lisp threads running at the same > time. Any pointers where to look for how to "halt" the main Emacs > thread? Or something? You can't "halt" the main thread, you can only wait for it to take a break. E.g. you could stuff your callback into pending_funcalls. Of course, pending_funcalls would then need to be protected by a mutex. Stefan