Hi!
My program (a raytracer) needs a lot of calculations so i thought it would be a good idear to use threads. I'm allready using the SDL lib in the program so the SDL threads seemed a good choice.
The program runs fine and a faster with treads, but it's still to slow. I tried speeding it up with the gcc optimization flags, but that just makes the program lock up. The optimization falgs works fine if i don't use threads.
I thought this might be a gcc thing so i tried compiling with visual studio, but with the exact same result: the program locks up right after it's started and i need to kill it, in order to close it.
During the lock up the program seems to run (~100% CPU usage).
- Has anyone tried to use the SDL threads alongside with compiler optimization?
- Can you recomend another way of using threads other than SDL, that would work better?
Thanks!
- JonLT