Contain unsafe in a few lines and wrap it in a safe API
You write split_at_mut yourself. You find out why safe Rust cannot express it, cut the unsafe down to six lines, and leave behind a written account of why it is sound.
Projects / Programming languages / Advanced
What you end up with
A counter that four threads always agree on, with measured times for Mutex, Atomic and local totals. And the ability to say where Rust's guarantee stops (it does not prevent deadlock).
Sign up for a free membership to read every free project. Already have an account? Please sign in.
Log in to send a report.
You write split_at_mut yourself. You find out why safe Rust cannot express it, cut the unsafe down to six lines, and leave behind a written account of why it is sound.
Writing async does not help if there is no await to yield at. You watch a heartbeat skip, then fix the difference between gather and TaskGroup and the way cancellation is handled.
You print the peak with tracemalloc and cut it in two directions: making one item smaller (__slots__) and holding fewer at once (generators). The second one is what pays.