[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Async DNS lookups

From: Lars Magne Ingebrigtsen
Subject: Re: Async DNS lookups
Date: Tue, 02 Nov 2010 19:13:30 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> If so, this sounds like a no-brainer to do in C instead of in dns.el.
> Patch welcome,

I meant for somebody who knows what they're doing.  :-)

I, like, see it happening like this:

1) User does: (resolve-async "gwene.org" #'my-callback my-data)

2) C does pthread_create() (right?), and lets the main thread return
   from the call.  The other thread just does a normal getaddrinfo().

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?   
(domestic pets only, the antidote for overdose, milk.)
  address@hidden * Lars Magne Ingebrigtsen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]