2011/9/1 Jonathan Lundell <[email protected]> > If it's convenient, you might experiment with calling time.sleep(0) fairly > frequently in your CPU-bound simulation app, perhaps in some inner loop, to > yield to other threads. >
I tried time.sleep(0), but it didn't have any effect. I tried time.sleep(0.1), but it made the simulation very slow and it didn't have any effect on welcome application, which didn't respond at all during the simulation. > Another (or supplementary) approach is to serialize your simulations, which > might take some refactoring. The idea here is to have a single thread that > runs the simulations from a queue, one at a time, so only one simulation > thread is contending for CPU resources. > Sounds complicated. > Or push the simulations into another process altogether, and use the OS's > process priority mechanisms. Ok. Maybe I'll give this a try. Henri.

