2 ms·
No, threads and processes are different. Threads are pieces of concurrent execution with a shared state from the containing process. Processes are heavier piece
by scrame 16y ago
No, threads and processes are different. Threads are pieces of concurrent execution with a shared state from the containing process. Processes are heavier pieces of execution, they have their own memory and state, get a distinct PID.
fork() is a system level command that copies the current process wholesale, and then gives a pointer back to the parent process. This is very different than an interpreter managed green thread (ala ruby 1.8), or a true concurrent in-process threading model (like JVM threads).
Basically, processes tend to be heavier-weight, but more isolated and secure, where threads tend to be faster and can work with shared state without needing to use IPC mechanisms.
Quick googling found this discussion: http://stackoverflow.com/questions/807506/threads-vs-processes-in-linux http://stackoverflow.com/questions/807506/threads-vs-process...