Skip to content

Instantly share code, notes, and snippets.

View Matthias247's full-sized avatar
💭
👨🏻‍💻⛷🚵🏻‍♂️

Matthias Einwag Matthias247

💭
👨🏻‍💻⛷🚵🏻‍♂️
  • Vancouver BC, Canada
View GitHub Profile
@Matthias247
Matthias247 / async_await_interfaces.md
Last active April 5, 2023 18:08
# Async/Await - The challenges besides syntax

Async/Await - The challenges besides syntax

4 years after after the release of Rust 1.0, it seems like Rust is now finally getting close to getting support for async/await - a language feature which aims to make it easier to write programs in an asynchronous fashion (where multiple logical tasks get multiplexed on a lower number of OS threads).

One of the last steps before the feature is stabilized is choosing the best possible syntax. The discussions around syntax have triggered an enormous

@Matthias247
Matthias247 / async_await_cancellation.md
Created May 28, 2019 06:09
Async/Await - The challenges besides syntax - Cancellation

Async/Await - The challenges besides syntax - Cancellation

This is the second article in a series of articles around Rusts new async/await feature. The first article about interfaces can be found here.

In this part of the series we want to a look at a mechanism which behaves very different in Rust than in all other languages which feature async/await support. This mechanism is Cancellation.

@Matthias247
Matthias247 / gist:fbdd66ae096cda2c7ca7848613d61d01
Created September 9, 2019 06:34
Channel benchmark results
Channels (Single Threaded)/intrusive local channel with producers/5
time: [31.879 us 36.663 us 45.492 us]
Channels (Single Threaded)/intrusive local channel with producers/20
time: [25.602 us 25.952 us 26.363 us]
Channels (Single Threaded)/intrusive local channel with producers/100
time: [58.846 us 62.851 us 66.238 us]
Channels (Single Threaded)/intrusive channel with producers/5
time: [37.125 us 37.235 us 37.315 us]
Channels (Single Threaded)/intrusive channel with producers/20
@Matthias247
Matthias247 / a_case_for_cancellationtokens.md
Last active January 17, 2022 22:50
A case for CancellationTokens

A case for CancellationTokens

Background

The Rust async working group is currently actively discusing on ways to improve async/await. Niko Matsakis documented the main goals and ideas in the async vision document.

As part of the improved async ecosytem, users should be able to make use of