@jsbarretto @natty a bit relevant to me this week as i build a new foundation for async i/o.
in C.
@jsbarretto @natty oh, i haven't decided what to do yet. like your example, is it worth spinning up a new thread for what could be a small op?
OTOH, if we don't do that, we have to have elaborate thread management
@jsbarretto @natty i know. but actually i think it's funnier that tokio starts tens of threads of my machine even if i do no i/o than that it does this.
also the docs said something about a 1000 thread default limit so shrug
Isn't that pretty much how non-blocking IO works? The syscall returns immediately if the bytes are already in memory, otherwise EAGAIN and wait for a notification via epoll.
But it doesn't work for files, for some reason…
@jsbarretto try it on a large project with a cold cache. Then it will take some time. Helix has that and it's very useful. On large projects (or even directories), the results come slowly and it's really helpful for it not to freeze.
Also you'll love it the day you start working on a slow network filesystem like sshfs.