From 96d01d88a98698e8c8435135185adfa402fd7b55 Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Mon, 3 Jun 2024 10:13:35 +0300 Subject: [PATCH] Clarify that the 8K restriction is not only for the hidden thread, due to how async-io works. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f9a68a..6fff3ba 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ So either: ## Justification -While `async-io` supports a ton of operating systems - _including ESP-IDF for the Espressif MCU chips_ - it does have a non-trivial memory consumption in the hidden thread named `async-io`. Since its hidden `Reactor` object is initialized lazily, it so happens that it is first allocated on-stack, and then it is moved into the static context. This requires the `async-io` thread to have at least 8K stack, which - by MCU standards! - is relatively large if you are memory-constrained. +While `async-io` supports a ton of operating systems - _including ESP-IDF for the Espressif MCU chips_ - it does have a non-trivial memory consumption in the hidden thread named `async-io`. Since its hidden `Reactor` object is initialized lazily, it so happens that it is first allocated on-stack, and then it is moved into the static context. This requires the `async-io` thread (as well as _any_ thread from where you are polling sockets) to have at least 8K stack, which - by MCU standards! - is relatively large if you are memory-constrained. In contrast, `async-io-mini`: - Needs < 3K of stack with ESP-IDF (and that's only because ESP-IDF interrupts are executed on the stack of the interrupted thread, i.e. we need to leave some room for these);