Embracing Thread-Per-Core Architecture
DRANK

Embracing Thread-Per-Core ArchitectureWhat is "thread-per-core" ?The term "thread-per-core" is confusing. It implies that there is one thread for each CPU core.Aren't most modern multi-threaded async runtimes already following thread-per-core? Since most modern async runtimes use the M:N threading model. It spawns multiple N OS threads to handle M tasks concurrently.However, the community refers to the term "thread-per-core" as a single-threaded runtime. Tasks are pinned to a specific thread.Projects such as monoio, compio, and glommio are advertised as thread-per-core runtimes.Why "thread-per-core" ?Some algorithms only function correctly or work best in single-thread context. The task may use thread-local storage.In this model, the tasks are pinned to a thread, which is a very powerful trait. The data is allowed to be mutated using a shared reference. Also, the CPU can execute more efficiently because data stays hot in the cache.What I really like about this model is that the runtim…

nurmohammed840.github.io
Related Topics: