emacs-devel
[Top][All Lists]
Advanced

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

Asynchronous DNS resolving


From: Lars Ingebrigtsen
Subject: Asynchronous DNS resolving
Date: Fri, 13 Feb 2015 18:10:24 +1100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

The major usability problem in eww now seems to be synchronous DNS
resolution.

When you go to a web page, eww will render it, and then insert images
asynchronously.  All the network stuff happens pretty asynchronously --
except for the DNS lookups.  If you're unlucky, a lookup may take
several seconds, and there may be several of these lookups.  Meanwhile,
Emacs is pretty much frozen while waiting for the DNS packets to find
their way back to home base...

This is seriously yucky.

A few years back I looked into making the Emacs domain lookup thing be
asynchronous, but that was way beyond my knowledge of Emacs internals,
and what happens when I fork Emacs, and what Emacs Lisp primitives can
be used in the forked instance.

So perhaps doing what Firefox used to do in the 90s would be a possibly
solution, anyway?  That is, have a teensy multi-threaded executable that
reads commands from STDIN and outputs the replies on STDOUT.  Like
lib-src/dns-helper.c or something.

The command format would be something like

<tag> <command> <data>

I.e.,

45 lookup fsf.org
46 lookup images.fsf.org
...

(Tags for streaming commands and matching up the responses with the
requests, a la IMAP.)

We'd then have something like

(with-domain-name-lookup (ip "fsf.org")
  (message "We got %s and now we're going to connect" ip)
  (with-url ("http://fsf.org"; :ip-address ip ...)
    (pop-to-buffer (current-buffer))))

to do a completely asynchronous web request.

Or does anybody have a better idea for solving this problem?

-- 
(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]