<story><title>Scipio: A Thread-per-Core Crate for Rust and Linux</title><url>https://www.datadoghq.com/blog/engineering/introducing-scipio/</url></story><parent_chain></parent_chain><comment><author>Luker88</author><text>I am a fan of the thread-per-core model, but I do not share their views on the data sharding per core&lt;p&gt;While it increases the data locality, I have seen a few software following this sharding model (notably scylla) that work really bad once the load is not evenly distributed across all shards&lt;p&gt;When that happens it can be a huge waste of resources and can give lower performance (depending on the type of load)&lt;p&gt;Imho unless you are absolutely sure about the type of load, leave the sharding to dividing data between servers, or have some mechanism that can shift to sharing the load between threads if the system imbalance is too great</text></comment>
<story><title>Scipio: A Thread-per-Core Crate for Rust and Linux</title><url>https://www.datadoghq.com/blog/engineering/introducing-scipio/</url></story><parent_chain></parent_chain><comment><author>BenoitP</author><text>I&amp;#x27;ll go against the grain here and say that async&amp;#x2F;await, wether implemented by one thread-per-core like here or by stackless coroutines is not the solution.&lt;p&gt;Async&amp;#x2F;await will make complexity explode because of the colored function problem [1].&lt;p&gt;The solution to expensive context switches is cheap context switches, plain and simple. User-mode lightweight threads like go&amp;#x27;s, or upcoming Java&amp;#x27;s with Loom [2] have proven that this is possible.&lt;p&gt;Yes, it does mean that it can only happen in a language that controls its stack (so that you can slice it off and pop a continuation on it). I sincerely believe this is Rust&amp;#x27;s ballpark; hell they even started the project with that idea in mind.&lt;p&gt;[1] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;journal.stuffwithstuff.com&amp;#x2F;2015&amp;#x2F;02&amp;#x2F;01&amp;#x2F;what-color-is-your-function&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;journal.stuffwithstuff.com&amp;#x2F;2015&amp;#x2F;02&amp;#x2F;01&amp;#x2F;what-color-is-...&lt;/a&gt;&lt;p&gt;[2] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jdk.java.net&amp;#x2F;loom&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jdk.java.net&amp;#x2F;loom&amp;#x2F;&lt;/a&gt;</text></comment>