In every modern OS that I know of, everything works in a thread that runs in the process. The OS can track multiple processes, and each process can accept an arbitrary number of threads. Thus, all code is executed in the thread and inside the process (since the thread is executed in the process).
The main difference between the two is that each process has its own virtual address space. Individual processes do not have access to each other's data, files, or anything else, and essentially do not know that other processes exist.
On the other hand, each thread in the process has the same address space, and therefore all threads can check or change each other's data, call the same functions and everything else.
Often (but not always) cases when one program consists of one process and several threads.
jalf Dec 05 '08 at 18:31 2008-12-05 18:31
source share