title: SDL freezes but continues to run
body: <p>I have written a program to draw Julia sets and store them in a .bmp file, using SDL 1.2, on windows 7. The program is designed to scan each pixel and draw a certain color, updating the screen regularly, and when that is done, to store the image in a file and wait for the user to exit.</p>
  
  <p>The program compiles and runs OK. However, and this annoys me, after a while the screen will freeze, though the program keeps running. When all the computations are finished, the screen unfreezes, the file is stored correctly, and the program exits normally when the user quits. Also, if the user toggles the window before the calculations are finished and then comes back to it, the screen freezes.</p>
  
  <p>The program itself requires a lot of CPU but very little memory.</p>
  
  <p>Any idea how to fix this ?</p>
  
  <p>Note : first posted on programmers.stackexchange but apparently that was not the right place for the question :-)</p>