On 2008-02-28, laider.TakeThisOut@live.com <laider.TakeThisOut@live.com> wrote:
>
> Just curious. I've been following this discussion and you both seem
> to set apart processes and threads without comment. What is the
> distinction? I thought they were pretty much the same thing.
The precise differences are almost infinitely debatable. As Kony
has already pointed out, it is always true to say that a thread is
owned by a parent process, and a process may have many threads.
However, there are apps that are split into multiple processes.
This is much more common under Unix but can apply equally to any
multitasking operating system.
For most purposes you are pretty safe to say that a process has
its own address space whereas a thread shares its address space
with all other threads in that process. This means that the usual
memory protection between processes that is provided by the OS does
not apply to threads of the same process.
This does mean that if a thread goes haywire it can interfere with
the other threads, but also that they can communicate with each
other very efficiently as they all have access to each others data
structures. There are also some performance advantage to threads
over processes because of the common address space. When switching
between two threads of the same process the page tables do not need
re-loading and various caches do not need invalidating.
--
Andrew Smallshaw
andrews.TakeThisOut@sdf.lonestar.org
>> Stay informed about: Is it worth upgrading a 3500 single core for a 4400 dual c..