How to make a foreign function run as fast as possible in Windows?

Paul Moore p.f.moore at gmail.com
Wed Sep 28 11:30:41 EDT 2016


On Tuesday, 27 September 2016 02:49:08 UTC+1, jf... at ms4.hinet.net  wrote:
> This function is in a DLL. It's small but may run for days before complete. I want it takes 100% core usage. Threading seems not a good idea for it shares the core with others. Will the multiprocessing module do it? Any suggestion?

Taking a step back from the more detailed answers, would I be right to assume that you want to call this external function multiple times from Python, and each call could take days to run? Or is it that you have lots of calls to make and each one takes a small amount of time but the total time for all the calls is in days?

And furthermore, can I assume that the external function is *not* written to take advantage of multiple CPUs, so that if you call the function once, it's only using one of the CPUs you have? Is it fully utilising a single CPU, or is it actually not CPU-bound for a single call?

To give specific suggestions, we really need to know a bit more about your issue.

Paul



More information about the Python-list mailing list