Skip to content
Discussion options

You must be logged in to vote

The thread pool is essential for operations that do not have any native async API. For example, there is no way to asynchronously read a file on macOS/BSDs. So the read operations go through the thread pool. It's the sam model that e.g. libuv uses. You can avoid the thread on io_uring, but on every other system, it's not possible to get rid of it without blocking the event loop.

I could make it possible to reuse a single thread pool for multiple instances, if you want to use it that way.

For the edited out userdata question, all operations except for task spawning work based on the current scope. If you are running from within a task, they use the event loop. Otherwise they use blocking o…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@psznm
Comment options

@psznm
Comment options

@lalinsky
Comment options

@lalinsky
Comment options

Answer selected by psznm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants