News for hackers. Stuff that matters.
Re:Comparison of Rust async and Linux thread context switch ... by Serow225 on Friday February 12, 2021 @11:46AM (#26115550)
My teams/company uses it all over, so maybe depends on the context you work in?

And FWIW, this explicit form is often unnecessary - if you kick off each task they will run in parallel and then just await each task only when the result is needed, it can look a lot cleaner:

        var p_t = GetUserPermission(username);
        var c_t = GetServerConfig();
        var m_t = GetMessageOfTheDay();

        var foo = isAuthorized(await p_t);
        // more code here
        var msg = ( (await c_t).ServerName + await m_t) );
Re:Comparison of Rust async and Linux thread context switch ... by littlestymaar on Friday February 12, 2021 @01:49PM (#26117019)
True, this doesn't work in Rust though, because nothing at all happens before the first time you poll a future, so you need an explicit task (but as other pointed out, it's pretty straightforward thanks to the `join!` macro).
Re:Comparison of Rust async and Linux thread context switch ... by Serow225 on Tuesday February 16, 2021 @03:08PM (#26158184)
Same as F# It uses 'cold' tasks, unlike C# that uses 'hot' tasks that start running immediately. But the F# way can compose in more advanced ways.