>> Not all requests run on the thread pool. Currently work requests (those used with uv_queue_work) and filesystem requests (uv_fs_*) run on the thread pool, other requests such as the ones used for uv_connect, uv_write or uv_shutdown do not.
>
> Do the other requests then just be executed sync?
>
No. A request is basically the representation of an action that will
happen later. They all take a callback where the result will be reported.
When you want to write data to a uv_tcp_t handl, for example, you'd
create a request, attach the buffers and call uv_write. Then libuv will
take care of watching the fd for writability and call the blocking
write() (or writev) syscall with the buffers you supplied. Once the
write has been performed, your callback will be called and you can free
the memory you allocated for the buffers, the request and what have you.
>>
>> libuv uses epoll, kqueue, etc to wait for events for the specified amount of time. If you are using libuv a call to uv_run will block the entire process, but the eventloop will process timers, and fire callbacks just fine, you don't need to manually poll the event loop yourself.
>
> I currently can only speak for kqueue do not know how epoll, etc. work.
> As I understood so far kqueue`s kevent() is used to set new events and to retrieve active events.
> So you are required to call kevent() to check for new events.
Yes, but libuv takes care of that for you.
> As you now said this manual check for new events is done through timers (so flibuv checks in an interval for new events)?
>
It's a bit more involved. If there are timers only, then libuv will
block for as much as the closest timer, if there are idle handles it
will do a 0 timeout poll, but if there are tcp handles only, for
example, if will do an unlimited poll, until an event happens on any of
the fds.
> Can you recommend articles for further reading to this topic?
>
I'm not an expert myself :-) but on what topic do you want to further
read? libuv abstracts platform dependent stuff such as the poll backend
and offers a completion-style API instead of a readiness-style one, but
that's kind of a detail of how libuv is implemented.