this post was submitted on 13 Oct 2025
10 points (85.7% liked)
Cool GitHub Projects
1597 readers
1 users here now
Wormhole
Icon base by Caro Asercion under CC BY 3.0 with modifications to add a gradient
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This doesn't appear optimal. The correct way to melt a CPU is to make use of as many functional units as possible in parallel, while avoiding pipeline stalls and cache misses. I'm not a Rust guy, but skimming through the code it seems like the only work it's doing is some integer math, so it's not even touching the FPUs. Also I see
while running.load(Ordering::SeqCst). Idk if Rust's memory model is similar to C++, but does that mean it's using atomic operations? That's going to create a lot of unnecessary cache coherency traffic that works against the goal of melting. Each thread should have its own counter not shared with other threads, and it should only spawn enough threads for the number of physical cores (not logical cores) on the system, and ideally pin each thread to a single core to prevent the OS from acting like a firefighter.The gpu parts I'm not sure about. There's might be some special consideration required when dealing with integrated graphics though.
Yeah, Rust borrows memory model from C++ because it's already in use and is at least somewhat understandable