emacs-devel
[Top][All Lists]
Advanced

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

Re: Asynchronous DNS


From: Alain Schneble
Subject: Re: Asynchronous DNS
Date: Tue, 2 Feb 2016 22:27:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Alain Schneble <address@hidden> writes:

> Lars Ingebrigtsen <address@hidden> writes:
>
>> I'm guessing they'll die along with Emacs.  That's what happens with
>> threads started by libraries currently, I think.
>
> If so, depending on how network resources are used, it may not release
> them properly.  They /might/ be released while the process is being
> stopped.  But will they be released in any case?  After all, it sounds a
> bit awkward to rely on such a behavior even if it would just work.
> Doesn't it?

Well, I now see that the async dns lookup is initiated using
`getaddrinfo_a' with GAI_NOWAIT and what it does behind the scenes is
hidden.  As Florian pointed out, it uses threads under the cover.  But
maybe it's not relevant at all for this discussion.

But still, I wonder why there is no call to `gai_cancel' at all.  In
`wait_reading_process_output', there is the call to `check_for_dns'.
I would expect a call to `gai_cancel' somewhere in
`wait_reading_process_output' or the like to explicitly cancel the
corresponding pending async request(s), e.g. when cancelling with `C-g'
or when killing the process.  Am I missing something?  Or would that
just be a nicety that nobody cares about?

And please bear with me, it's the first time I look into `process.c'
(and c source code as well...).

Thanks!
Alain




reply via email to

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