home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / advocacy / 3306 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  2.8 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!mips!newsun!cpclark2.Test.NPD.Provo.Novell.COM!dliechty
  2. From: dliechty@novell.com (Don Liechty)
  3. Newsgroups: comp.os.os2.advocacy
  4. Subject: Re: nt, an assessment
  5. Message-ID: <dliechty.1.712274784@novell.com>
  6. Date: 27 Jul 92 22:06:24 GMT
  7. References: <1992Jul23.2712.2814@dosgate> <1992Jul24.010711.1625@grebyn.com> <1992Jul27.161801.3357@njitgw.njit.edu>
  8. Sender: usenet@novell.com (The Netnews Manager)
  9. Distribution: comp
  10. Organization: Novell, Inc., Provo, UT, USA
  11. Lines: 59
  12. Nntp-Posting-Host: cpclark2.test.npd.provo.novell.com
  13.  
  14. In article <1992Jul27.161801.3357@njitgw.njit.edu> dic5340@hertz.njit.edu (David Charlap) writes:
  15. >From: dic5340@hertz.njit.edu (David Charlap)
  16. >Subject: Re: nt, an assessment
  17. >Date: 27 Jul 92 16:18:01 GMT
  18.  
  19. >In article <1992Jul24.010711.1625@grebyn.com> richk@grebyn.com (Richard Krehbiel) writes:
  20. >>
  21. >>As far as I understand, there's not a way in OS/2 to implement fork().
  22.  
  23. >Correct, although the functionality of fork() exists in the form of
  24. >two separate API calls: DosCreateProcess, and DosCreateThread (I think
  25. >those are the names).  One launches a new program, and the other
  26. >begins a parallel thread of execution.
  27.  
  28. >The Unix fork() combines thse.  When a process does a fork(), a second
  29. >thread is launched.  The second thread executes the same code as the
  30.  ^^^^^^
  31.  
  32.  Not quite true.  It is not a thread, it is a seperate process identical
  33.  to the first.
  34.  
  35. >parent, and from the same instruction.  The only difference is that
  36. >the child gets a 0 as a return value from fork(), and the parent gets
  37. >the process ID of the child.  If the child executes another program
  38.      ^^^^^^^
  39.  
  40.  Correct!
  41.  
  42. >(via exec(), which replaces the calling process with the program just
  43. >called), then you've just launched a new process.  If the child
  44.                                       ^^^^^^^^^^^
  45.  
  46.  The new process was created at the time of the fork, and then replaced
  47.  by exec().
  48.  
  49. >branches to a procedure, you've just launched a new thread.
  50.                                                  ^^^^^^^^^^
  51.  
  52.  Again, it is not a thread. It is a seperate process identical to
  53.  the first, which could  have a different path of execution based on 
  54.  whether the return code is the process ID of the child (in the case of the
  55.  parent) or 0 (in the case of the child). That is precisely why they call 
  56.  them parent and child (processes).
  57.  
  58.  
  59. >Obviously, there are some other differences, but this is why OS/2
  60. >can't fork().  
  61.  
  62. >-- 
  63. >   |)  David Charlap           "I don't even represent myself
  64. >  /|_  dic5340@hertz.njit.edu   sometimes so NJIT is right out!.
  65. > ((|,)
  66. >  ~|~  Hi! I am a .signature virus, copy me into your .signature file.
  67.  
  68.  The concept of a thread historically has not existed in UNIX, but I 
  69.  have heard that later versions (System V 4.2 ??) do support threads.
  70.  Anyone know for sure?
  71.  
  72. Don Liechty
  73.