原书出处
Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)
01 Chapter 1. Introduction to Async 线程并行与共享状态
cvar.wait(received_value).unwrap(); println!("Received value: {}", *received_value); } });
Here we can see that we wait on the Condvar notification. At the point of waiting, the thread is said to be parked. This means that the thread is blocked and not executing. Once the notification comes in from the Condvar, the thread accesses the variable in the Mutex after being woken by the Condvar. We then print out the variable, and the thread goes
back to sleep. We are relying on
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch01.html#id6
EPUB SHA-256:109ff0224da54833b0d49c82502e850845274913fe34a7168dcf36a9c075b4e0