Subj : Threads and processes on Linux To : comp.programming.threads,comp.os.linux.misc,comp.sources.d From : Generic Usenet Account Date : Wed Mar 30 2005 10:12 am I have often heard that in a Linux environment there is no difference between threads and processes. I want to know if that is merely "rhetoric" or if that is really so. For example, I have seen that getpid() in all threads returns the same value (as I think it should). This means from the perspective of operations associated with processes (ps, signal etc.), all the threads are viewed as a single entity. Also, if the spawning thread terminates (e.g. it does not do a join on the spawned thread), the spwaned thread also seems to terminate. In other words, the lifetime of a spawned thread does not seem to exceed the lifetime of the spawning thread. This is quite different from processes, where the lifetime of a spawned process is completely independent from the lifetime of the spawning process. In fact, if the spawning process terminates before the spawned process, the root process assumes ownership of the spawned process. So what exactly are we saying when we state that "there is no difference between threads and processes on Linux"? I think it merely means that unlike in the past, where tasks and light-weight processes did not have visibility outside the application, threads in Linux have limited visibility outside the application process and they are scheduled in the same way as processes are. However, I am not sure if my thinking is correct. Any insight will be appreciated. Thanks, Gus .