What is the best way to do this:
I have a 2GiB memory block that needs to be initialised with some data. Data are all independent, so I can easily spawn n threads to initialise the data in parallel with each thread working on a separate memory location.
How can I "tell" this to Rust. It won't allow me sharing the memory between threads (for good reason and rightfully so). I know there will be no race-condition because each thread works on totally separate memory locations.
One idea is to work with (crossbeam)channels. Each threads sends there computation to one writer that puts the memory into the right place. Alas this feels overly complicated and not efficient enough. Is there some way to partition the memory for threads to make it safe to be worked on with different threads?