News for hackers. Stuff that matters.
Re:Immutable.rs: immutable data structures for Rust by blaisio on Friday April 06, 2018 @09:46PM (#16778960)
So honestly they probably do. This is useful whenever you want to share and optionally modify some data (especially if it's large).

Eg. in a multi-threaded video game, for each frame, you probably have some big block of state, which some threads will mutate. Instead of making a copy of the data for every thread, you could pass around a big immutable data structure and only make copies when writing. Each thread can own their own data, so there won't be lock contention, and when all the threads are done, a quick merge operation can recombine the modified pieces back into a single block of state for the next frame.

There are no comments on this comment yet.