4 ms·
That's a terrible API. If you forget to unlock it, have fun pulling your hair out while debugging. Rust makes it so that you can't forget.
by gaganyaan 3y ago
That's a terrible API. If you forget to unlock it, have fun pulling your hair out while debugging. Rust makes it so that you can't forget.
- foooorsyth 3y agolol POSIX threads are far more battle-proven than any threading API in Rust. All of the underlying multi-threading on the system you made your comment from is using pthreads. It works fine in reality, despite all the pearl clutching. >Rust makes it so that you can't forget. And the tradeoff is an unreadable, puke-inducing one-liner. You can do a (readable) scoped lock with a macro in C (GCC defines the __attribute__ cleanup) or RAII-style with destructors in C++.
- gaganyaan 3y ago"Works fine" is an interesting choice of words for the absolute tire fire of a tech stack that modern tech currently depends on. You should probably see a doctor about your hyperemesis.