Is it worth taking the time to write the code to reuse threads in C, or are they cheap to create and destroy?
I'm rendering some CPU only 3D graphics and it was going pretty slow (looked like about 5 fps). I tried using threads to solve this. Using 4 threads, each rendering a strip of the screen, seemed to boost my frame rate to something very reasonable and smooth. I'm still worried about what will happen when I make my graphics more complicated. Would I get any appreciable speed boost by reusing my threads instead of creating and destroying them every frame?
Edit: The operating system I'm working on is Windows.
Since with 1 thread you got about 5 fps, presumably with 4 threads, you got to somewhere around 20 fps? So, you would be creating and destroying 80+ threads per second if you don't keep them around? Threads are fairly lightweight, but I think you'd begin to notice that much overhead.