emacs-devel
[Top][All Lists]
Advanced

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

Re: Asynchronous DNS


From: Lars Ingebrigtsen
Subject: Re: Asynchronous DNS
Date: Sun, 28 Feb 2016 15:13:41 +1030
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Alain Schneble <address@hidden> writes:

> 1. Suspend the thread using gai_suspend, waiting for the DNS request to
>    complete.
>
> 2. Calling a "blocker" similar to wait_for_socket_fds, to wait for DNS
>    request completion in a loop.  But this would need additional logic
>    in wait_reading_process_output, to not proceed with
>    connect_network_socket in case process deletion is pending.
>
> 3. Any other way of postponing freeaddrinfo.
>
> I'm not sure, but my gut feeling says that option #1 may be acceptable
> in this situation.  We might run into "suspend" only in corner cases, if
> the process is being deleted while a request is still being processed.

Yes, I agree.  Suspending seems like the best solution here, but I can
imagine unfortunate consequences when doing that.

For instance, if Emacs is shutting down, and it just calls
`delete-process' on everything (which it does, I think?), then Emacs
exit would hang until getaddrinfo returns (which may take many seconds).
(That is, if Emacs just has decided to resolve something in the
background, for instance by erc deciding to reconnect or something.)

Could we detect whether Emacs is shutting down, perhaps?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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