Process v.s. Threads

Main Difference

Why use threads?

Parallelism

single-threaded program can only use one CPU core where a multi-threaded program can use multiple CPU Cores.

Avoid blocking slow I/O

Some threads waits for slow blocking I/O, while other threads can perform useful computation.

Threading enables overlap of I/O with other activities within a single program, much like multiprogramming did for processes across programs.

Many morden server-based application such as web servers, database management systems, make use of threads in their implementations

One could still use multi-process instead of multi-thread, but threads share memory (an address space) thus make it easy to share data. multi-processes are better choice for logically separate tasks where little shareing of data structures in memory is needed.