Alex Esplin wrote: > This is going to show my inexperience in a big way, but I might as > well take the chance to learn some more today. > > Now that I know what fork() does, what kind of situations would you > want to use it in? I can see this as being really useful, but I don't > quite have my head wrapped around it yet. > > Thanks for being patient with me... > Dr. Mercer's Computer Architecture (CS345) class gave me my only experience with a practical use of forking. We wrote a small UNIX shell, and when the user typed in a command, the program would fork. This creates a new process with its own memory space, file descriptor table, signal handlers, etc. The child process would then exec (man 3 exec) the user's command, which takes over the process that was created by the fork command. If concurrency is the only goal, then threads will usually take care of the problem. However, if you need a completely new process with its own resources, then fork you. I mean, then you fork.
-- Topher Fischer GnuPG Fingerprint: 3597 1B8D C7A5 C5AF 2E19 EFF5 2FC3 BE99 D123 6674 [EMAIL PROTECTED]
signature.asc
Description: OpenPGP digital signature
/* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
