in reply to Forks and Spoons

Forking is, at its heart, a Unix term. It has to do with multi-processing, not multi-threading.

A quick primer. Processes are how the OS (be it Unix, Win32, or whatever) keeps track of the things that are using its CPU, RAM, etc. It is the way that a single-CPU machine can have multiple things happen on it at once, through the miracle of timeslicing. (If you want to read more, search for timeslicing on your favorite search engine.)

Threads are "processes within processes". According to the CPU, there's only one thing executing. According to the code, there's multiple things.

The reasons you want to fork are numerous. It could be anything from wanting to do data-munging in parallel to a web server handling multiple requests of a CGI script to the gods know what. What I've discovered is that, in over 8 years of programming, I've never wanted to fork ... not even once. Others work with forking on a daily basis.

There are a number of headaches dealing with forking, such as parent-child relationships, race conditions, data-sharing, signalling/communication, and overflowing the OS's process table ... just to name a few of the more common ones. If you do want to fork, read up on it. A lot. Then, read some other people's code. Try it out. Expect to have a number of issues and questions pop up.

Good luck. *winces*

------
/me wants to be the brightest bulb in the chandelier!

Vote paco for President!