Doh! Stupid Programming Mistakes <humor>
alex.esplin at gmail.com
Thu Oct 19 13:09:51 MDT 2006
On 10/19/06, Topher Fischer <javert42 at cs.byu.edu> wrote:
> 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.
So when the child process finishes with whatever command the user
entered does it then have a mechanism for killing itself off to avoid
a slower version of a fork bomb?
More information about the PLUG