News for hackers. Stuff that matters.
Re:Ask HN - Why was there ever, fork() ? by vinutheraj on Tuesday October 06, 2009 @08:06AM (#863939)
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.

You can read more about it here - http://groups.google.com/group/comp.os.research/browse_threa...

Re:Ask HN - Why was there ever, fork() ? by caf on Tuesday October 06, 2009 @09:20AM (#864034)
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().
Re:Ask HN - Why was there ever, fork() ? by jacquesm on Tuesday October 06, 2009 @08:25AM (#863960)
Plan 9 still is in many ways the most interesting thing to happen to the world of systems design after unix.

It deserves more attention.

Re:Ask HN - Why was there ever, fork() ? by Aegean on Tuesday October 06, 2009 @09:25AM (#864044)
So does the widely known OS called linux. man clone
Re:Ask HN - Why was there ever, fork() ? by vinutheraj on Tuesday October 06, 2009 @11:08AM (#864292)
Yea but I had heard somewhere that the linux clone was based on Plan 9 rfork.

"FreeBSD's rfork(2) and Linux's clone(2) system calls are modeled on Plan 9's rfork(2)"

source - http://catb.org/esr/writings/taoup/html/plan9.html