A quick test I made to easily find the best pattern for updating chunks with multithreading. Click to place, Space to remove. The red box is the chunk that would be updating, and the outline around it are the pixels that the ones inside the chunk could move to, and if two threads move their pixel into the same position at the same time, it would create a race condition, which we want to avoid. This is why making a pattern where the red boxes don't overlap is necessary for multithreading a program like the one this is for below. This is for a Godot plugin I am working on that can run a falling sand simulation and create functionality for easily making games like Noita with. The size of the grid of chunks can vary (x and y), so finding a pattern that would work for most grid sizes is going to be challenging. Oh, and by the way, i'm pretty sure the max threads that can be running at a time is 4. Help with this would be greatly appreciated!