On a related note, the Plan 9 system call rfork() gives a system call by which you can create new processes or lightweight processes(threads) with a single system call, deciding on what resources are to be shared between the new processes. There are no 2 discrete entities called processes and threads, just processes !
"In Plan 9, fork is not a system call, but a special version of the
true system call, rfork (resource fork) which has an argument
consisting of a bit vector that defines how the various resources
belonging to the parent will be transferred to the child. Rather
than having processes and threads as two distinct things in the
system, then, Plan 9 provides a general process-creation primitive
that permits the creation of processes of all weights." - Rob Pike.
That's actually how fork() is implemented today on Linux, too - the clone() system call can be used to implement either processes or threads (by specifying exactly what is to be copied and what is to be shared), and modern versions of glibc implement fork() by calling clone().
"In Plan 9, fork is not a system call, but a special version of the true system call, rfork (resource fork) which has an argument consisting of a bit vector that defines how the various resources belonging to the parent will be transferred to the child. Rather than having processes and threads as two distinct things in the system, then, Plan 9 provides a general process-creation primitive that permits the creation of processes of all weights." - Rob Pike.
You can read more about it here - http://groups.google.com/group/comp.os.research/browse_threa...