home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
- From: dic5340@hertz.njit.edu (David Charlap)
- Newsgroups: comp.os.os2.advocacy
- Subject: Re: nt, an assessment
- Message-ID: <1992Jul27.161801.3357@njitgw.njit.edu>
- Date: 27 Jul 92 16:18:01 GMT
- References: <1992Jul23.2712.2814@dosgate> <1992Jul24.010711.1625@grebyn.com>
- Sender: news@njit.edu
- Distribution: comp
- Organization: New Jersey Institute of Technology, Newark, N.J.
- Lines: 26
- Nntp-Posting-Host: hertz.njit.edu
-
- In article <1992Jul24.010711.1625@grebyn.com> richk@grebyn.com (Richard Krehbiel) writes:
- >
- >As far as I understand, there's not a way in OS/2 to implement fork().
-
- Correct, although the functionality of fork() exists in the form of
- two separate API calls: DosCreateProcess, and DosCreateThread (I think
- those are the names). One launches a new program, and the other
- begins a parallel thread of execution.
-
- The Unix fork() combines thse. When a process does a fork(), a second
- thread is launched. The second thread executes the same code as the
- parent, and from the same instruction. The only difference is that
- the child gets a 0 as a return value from fork(), and the parent gets
- the process ID of the child. If the child executes another program
- (via exec(), which replaces the calling process with the program just
- called), then you've just launched a new process. If the child
- branches to a procedure, you've just launched a new thread.
-
- Obviously, there are some other differences, but this is why OS/2
- can't fork().
-
- --
- |) David Charlap "I don't even represent myself
- /|_ dic5340@hertz.njit.edu sometimes so NJIT is right out!.
- ((|,)
- ~|~ Hi! I am a .signature virus, copy me into your .signature file.
-