colorcurvature opened this issue on Mar 24, 2013 ยท 7 posts
bagginsbill posted Sun, 24 March 2013 at 10:54 PM
Unlike unix-variants, in Windows, the multiprocessing module has to launch a new copy of the intepreter - there is no "fork" function.
In the case of Poser Python, the interpreter is Poser. You can't launch a new copy of Poser - Poser prevents two copies on purpose.
However, if you are not using Poser Python in your script, but rather just pure ordinary Python, (i.e. you're not using internal objects published by the Poser engine) you have the option to spawn a subprocess (not multiprocess) of an ordinary Python interpreter, and then let that multiprocess if it wants to.
If you're trying to do some difficult calculation (perhaps involving geometry) it may be better to export the geometry to a collection of pure-python subprocesses.
Side note: I have been experimenting with boost-python - an easy way to connect a pure C++ class library to Python and make it possible to call all the C++ methods without you having to write any glue code. This makes for some damn fast add-on modules for Python.
http://www.boost.org/doc/libs/1_53_0/libs/python/doc/index.html
When you call into C++, the global interpreter lock (GIL) is released so real multi-threading can happen. If you're doing the hard work in C++, you may not even need multiple CPU cores, but if you want them, they're a lot easier to deal with in C++. Well, easier being a relative term. A bunch of other stuff is harder. Depends on the problem. For me, it's cryptography and it's easier in C++ because all the crypto functions are in C.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)