[Tutor] running multiple concurrent processes
oscar.j.benjamin at gmail.com
Tue Oct 30 23:08:13 CET 2012
On 30 October 2012 21:10, richard kappler <richkappler at gmail.com> wrote:
> Oscar, thanks for the link, though I must say with all due respect, if it
> was "obvious" I wouldn't have had to ask the question. Good link though. I
> suspect the reason I didn't find it is I did my searches under threading as
> opposed to multi-processing.
Sorry Richard, I think you may have misunderstood. I didn't mean "this
is obvious so why ask the question?". Rather I meant "there are a
number of ways to do this but to me the obvious choice is
multiprocessing". I probably should have added more explanation but I
realised I needed to get back on with cooking dinner and thought I'd
just send a quick pointer.
Of course when I say it's the obvious choice that assumes that you are
sure that concurrent processes is what you want. You can achieve
similar things in a number of ways as Dave has described.
If you're not sure which of threads and processes you want then I'll say that
normally in Python threads are used to run IO-bound operations
concurrently. Python's threads are no good for CPU-bound operations so
multiprocessing is used in that case. Do you know which case your
application falls under?
More information about the Tutor