Closed zicklag closed 7 months ago
OK, I pushed an update that makes all the borrows ahead of time.
Each thread will do this for it's active chunk and work at the same time.
I implemented Index
and IndexMut
for ChunkGroup
, so you can use it almost like the vec you had earlier, and it will panic if you try to mutably access the surrounding non-mutable chunks.
Running the game, it will immediately panic because something is trying to mutate the sleeping chunks. I think maybe now ( whenever you get the chance ) would be a good time for you to check it out and see if you can figure out why it's writing to the immutable chunks.
Other than that, I think this design should work pretty well and be nice and fast.
Current status. Working pretty well, but there are two issues:
swappable()
that tries to borrow neighboring cells, that are being mutated by another thread.