Blog Posts
Thoughts on technology, programming, and development
-
Rust: Async vs Multi-Threading
Confused about when to use multi-threading vs async in Rust? This guide breaks down both approaches with practical examples, explaining race conditions, event loops, deadlocks, and the function coloring problem. Learn which tool to reach for and when.
-
Rust: How Thread-Local Storage Actually Works
A deep dive into Rust’s Thread-Local Storage implementation — exploring thread_local!, #[thread_local], eager vs lazy storage, destructor registration, and how TLS behaves inside async runtimes like Tokio.
-
Memory Allocation in Rust: Box, Vec, and the Global Allocator
A concise dive into Rust heap allocation: how Box and Vec use the global allocator, compute layouts, grow capacity, and safely deallocate via drop glue.
-
Rust: How the Compiler Manages Lifetimes
This post explores how Rust lifetimes and ownership are enforced at the assembly level, showing when rust_dealloc is called during moves vs borrows — all without any runtime overhead.