On Sat, Jan 19, 2002, Shlomi Fish wrote about "Creating a spawn system call": > > Hi! > > I have an idea for a Technion project in which we will add a spawn system > call to the Linux kernel. What spawn will do is fork a child process whose > memory contents will be read from a file. Similar to a fork and execve in > one go. Both fork() and execve are pricy (despite the fact the fork() uses > copy-on-write memory), so a system call that does them in one go would be > great for multi-processing.
There are two things you should know (if you don't know them already) 1. have you ever heard of vfork()? This was a 3.0BSD invention, that was similar to fork except that it wouldn't copy any memory, and the only thing you're allowed to do after a vfork() is an exec() (or _exit()). vfork was since then somewhat deprecated: 4.4BSD made it the same thing as fork(), and Solaris marks it as "This function will be eliminated in a future release.". However, Linux has it since kernel 2.2 (as a special case of clone(), probably). 2. As you said, Linux already doesn't have to copy any pages while forking. So is there really much overhead to calling fork() and exec*()? For more information, see the vfork(2) manual on Linux. > 1. fork() and execve() are already a complete set of process management, > so spawn would be redundant, and so probably won't be accepted in the > mainstream kernel. > 3. It would take some changes in user-land to make use of this new > functionality. Right, which is why I'm not sure why your idea is needed at all. To save a couple of microseconds on exec time - when modern programs spends dozens (if not thousands - see KDE) of miliseconds on dynamic linking every time you run them? Anyway, if it's just a project and not something you plan to get accepted into the kernel, then by all means, do it :) -- Nadav Har'El | Saturday, Jan 19 2002, 7 Shevat 5762 [EMAIL PROTECTED] |----------------------------------------- Phone: +972-53-245868, ICQ 13349191 |Attention: There will be a rain dance http://nadav.harel.org.il |Friday night, weather permitting. ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
