Multiple scripts versus single multi-threaded script

Grant Edwards invalid at invalid.invalid
Fri Oct 4 12:38:00 EDT 2013


On 2013-10-03, Roy Smith <roy at panix.com> wrote:

> Threads are lighter-weight.  That means it's faster to start a new 
> thread (compared to starting a new process), and a thread consumes
> fewer system resources than a process.

That's true, but the extent to which it's true varies considerably
from one OS to another.  Starting processes is typically very cheap on
Unix systems.  On Linux a thread and a process are actually both
started by the same system call, and the only significant difference
is how some of the new page descriptors are set up (they're
copy-on-write instead of shared).

On other OSes, starting a process is _way_ more expensive/slow than
starting a thread.  That was very true for VMS, so one suspects it
might also be true for its stepchild MS-Window.

-- 
Grant Edwards               grant.b.edwards        Yow! RELATIVES!!
                                  at               
                              gmail.com            



More information about the Python-list mailing list