A process has its own address space, file descriptors and resources; a thread is a unit of execution inside a process, and all threads of a process share its code, heap, global data and open files, while each has its own stack, registers and program counter.
Creation and switching are cheaper for threads, and communication is easy through shared memory (but needs synchronization to avoid races); processes are better isolated, so a crash in one does not usually kill another.
Use processes for isolation and security, threads for fine-grained concurrency within one application.
Loading…