Remix.run Logo
throwaway81523 3 days ago

There might be a way to getaddrinfo asynchronously with io_uring by now. Otherwise just call the synchronous version in another thread and let it time out so the thread exits normally, right? Why bother with pthread_cancel?

yxhuvud 3 days ago | parent | next [-]

No. Getaddrinfo is libc, not the kernel. It is of course possible, but complicated, to implement dns resolution with io_uring, but making it behave the same as glibc is very much a nontrivial piece of work.

gary_0 3 days ago | parent | prev | next [-]

The problem is that the standard library function is specified to be blocking (and it's in userspace, so io_uring is not relevant). It's quite possible to do a non-blocking DNS lookup but you have to use a separate non-standard library (like c-ares).

loeg 3 days ago | parent | prev | next [-]

io_uring is for calling kernel APIs; this is a userspace API.

1over137 3 days ago | parent | prev [-]

io_uring is a linux-ism, curl is cross-platform.