Starting new threads is expensive! You definitely should not be doing that every frame.
Lol thanks for the tip. Given my landscape is an [,] array of chunks, how do I pass the new coords pointing to a chunk to an existing and maybe running thread? Or would it be best to compile a list of chunks needing an init, and let the loader thread check it? Regardless of which is best, I will still need a little help getting threads to work right.
EDIT: Ok. So I set up a Queue and a worker thread that loads chunks, but now about every second and a half, regardless of where I am, where I am facing, whether or not I'm moving, my framerate drops for a quarter of a second. My chunk loading thread method is as such:
private void LoadChunks()
if (loadingQueue.Count > 0)
Vector2 chunkPosition = (Vector2)loadingQueue.Dequeue();
world.Landscape[(int)chunkPosition.X, (int)chunkPosition.Y].Generate(world.Content, world.Rand);
This really started happening when I had to modify my Block class to handle the possibility for neighboring blocks being part of a null chunk without throwing an exception. The current implementation of this is such that if the neighboring chunk is null, or the chunk isn't null but hasn't been generated, set the face facing that chunk to draw.