A device has limited cores, and too many threads can cause high scheduling and memory overhead.
HarmonyOS provides the ArkTS and FFRT task pools for unified scheduling.
The JS part of the ArkTS thread is implemented using the actor model, with each thread having its own independent JS environment instance. As a result, starting a thread consumes a significant amount of memory.
In other operating systems, the large number of application threads results from synchronization locks and synchronous I/O programming.
In HarmonyOS, asynchronous I/O calls are distributed to the I/O thread pool without blocking application threads. Therefore, the number of threads required is far less than that in other operating systems.