On 11/16/2011 01:22 PM, Dave Angel wrote:
(You're top-posting.  Put your remarks AFTER what you're quoting)

On 11/16/2011 12:52 PM, Jack Keegan wrote:
Ok, I thought that processes would do the same job as threads. So would the
general rule be some thing like so:

If I want another piece of work to run (theoretically) along side my main
script, and I want to share data between them, I should use a thread and
share data with the thread-safe queue.
If the work I want done can function and complete on its own, go for a
process.

Would that be about right?


Yes, with all the caveats I mentioned before. With some language implementations, and with some operating systems, and on some CPU-systems, the guidelines could be different. They all trade off in ways too complex to describe here.

For example, if a thread is mostly doing I/O, it may be just as efficient as a separate process, even if sharing data isn't an issue.

And in some languages, sharing data between processes isn't all that tough, either.


Well, you sent me a mail without including the list (just use Reply-All), and I tried to add the list in. Unfortunately, I picked the wrong one, so i sent this to Tutor by mistake. I'll try to fix that now, sorry.




--

DaveA

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to