Python Threading front end
ajb128 at hotmail.com
Sat Feb 1 01:36:51 CET 2003
I'm working on a project that does loooong and slow simulations. We
have a lot of code done already in C++, but we have no user interface
to speak of. To run a simulation, you tweak the source files,
recompile, run, come back tomorrow and hope it worked.
We have 2 main goals for the next phase of the project. 1)
Multithreading in hopes using multiple processors to speed things up.
2) Put a nicer front end on everthing so other people can easily
change parameters, run the simulation, and then analyze some of the
results. I'm looking at python already to do the UI and add scripting
capability, looks like it will be a good fit thanks to SciPy and
We're having problems with the threading. The program runs on both
windows and Linux and we're having trouble finding a good, free,
multi-platform threading library that doesn't clobber our build
process. The simluation is really easy to make parrallel, we just
need to run the same function over and over. So my thought is maybe we
could use python to do the multithreading as well.
I see that python has no problem running multiple threads as long as
the threads aren't running python code. So this is fine- only the UI
code would be in python. But, I don't really see how to control a
C/C++ function that is running in a thread from python. For example,
we might want to pause one thread of the simulation, examine its
intermediate results, and then continue the simulation.
So, to make a the long of it short:
Does anyone have any suggestions or pointers to similar projects?
Does anyone have any good thread examples? I've looked some but
haven't found much.
Can you "pause" a thread?
Is any of this even worth trying to do?
More information about the Python-list