[Csci551-talk] Re: [Cs551] Fork
xiw at usc.edu
Sat Mar 19 14:02:49 PST 2005
jung suh wrote:
> I read from the book there are two ways to fork
> 1. Fork so that you make new copy of itself to do some task
> 2. Fork and then call Exec
> When forking for tracker and clients, should we fork using 1 or 2?
> If 2, we should create separate source files for tracker and clients, right?
For 2, you need two separate EXECUTABLES for tracker and clients. So
there would be at least two source files.
> If 1, basically we separate functions of clients, tracker, manager
> by checking if the forked process is child process(by chekcing pid) or parent process?
Yes. But you can still use separate source files.
You can use either approach 1 or 2.
More information about the Csci551-talk