2 ms·
With .blocking mode, this example seems like it should operate differently. var sendFrame = async send_message(addr); // ... do something else while
by karmakaze 4y ago
With .blocking mode, this example seems like it should operate differently.
var sendFrame = async send_message(addr);
// ... do something else while
// the message is being sent ...
try await sendFrame;
In .blocking mode there can be no parallelism, if I'm correctly interpreting what the compiler does.
Maybe the part that's different than what I expected is that it works like node with a single event loop rather than in Go where the number of parallel running goroutines defaults to the number of CPU hardware threads.
- subarctic 4y agoIn .blocking mode, does `async send_message(addr)` spawn a new OS thread? If it does than you could still have parallelism (or at least concurrency, if I remember the difference between those two correctly).