3 ms·
You don't need an Arc with atomics https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fc20109626a8eb28d34a412924c1974d https://play.rust-l
by steveklabnik 5y ago
You don't need an Arc with atomics
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fc20109626a8eb28d34a412924c1974d https://play.rust-lang.org/?version=stable&mode=debug&editio...
- tialaramex 5y agoSure, however now your atomic has 'static lifetime so it lives forever and that's sort of cheating. The reference counter means nobody in particular needs to be in charge of cleaning up, whoever has it last will drop it. Call it personal preference. Also, is the broken kinda of look of your blog an aesthetic choice or a bug? Is "![Today%20is%20my%20first" really what that ought to display under the title ? I feel like it probably isn't.
- steveklabnik 5y agoI don't see how 'static is cheating, that's the semantic you want: to be able to live as long as the various threads. If you used scoped threads you wouldn't need 'static, but those are less general, so I didn't get into it. No, it's just buggy. :( Thanks for mentioning though, that bug is not one I had seen just yet.