Locking
Locking
Posted Sep 24, 2024 20:02 UTC (Tue) by daroc (editor, #160859)In reply to: Locking by Cyberax
Parent article: Resources for learning Rust for kernel development
One also can drop the guard explicitly:
drop(guard);
So I don't think it's less flexible, really. But, as in every discussion about programming languages, it's not really about what's possible so much as what the language makes easy or hard. I think it's a good point that Rust's locking is less explicit! That's certainly true, and it is a tradeoff. I (personally) think that the guarantees the compiler provides are worth it, but that doesn't mean we shouldn't acknowledge that less explicit locking does have downsides.
