Yay, my patch to add `Arc::{incr,decr}_strong_count` has landed on Nightly! This should help make it easier to build manually managed thread-safe reference counters. Somewhat niche, but useful when you need it!https://github.com/rust-lang/rust/pull/70733 …
-
Show this thread
-
A common question is: "Why not use atomics instead?" Atomics don't implement Clone. Which means the easiest way to share them between threads is... to put them in an Arc! Which means you're now using atomics to share atomics. And that kind of defeats the point.
2 replies 0 retweets 1 likeShow this thread
The reason why I wrote this patch is to help make it easier to write Executors. Each Future is passed a Waker (e.g. a callback with no args). Wakers need to implement Clone so they can be stored and later called on wake-up. This patch makes implementing Wakers by hand easier!
1:00 AM - 8 May 2020
from Berlin, Germany
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.