On Wed, 20 Mar 2002, Joel VanderWerf wrote:

> Dennis Newbold wrote:
> 
> >     H'mm .. a pseudo child process which lives in the same address space
> >     as its parent.  Sounds pretty much like a thread to me.  Ruby already
> >     has threads.  So.. as a bottom line .. if under Windows, we alias
> >     fork to Thread.new, we can add to Ruby the same level of fork()
> >     that ActiveState just spent umpteen thousand man-hours putting in.
> 
> Ruby threads are within the process, not OS threads. So if the reason
> you're forking is to call system(), then you can't get fork behavior
> from threads.
> 
Quite true.  But its likely that an ActiveState Perl "pseudo child process
running in the same address space" has the same limitation.  And, if you
are forking just to call system(), you might want to consider:

   using Ruby back-ticks as in:  files = `dir`

or, using the Win32API:: module services to invoke the Windows
CreateProcess() API, which basically does the same thing as a fork()
followed by (in the child process) a call to execlp or execXXX
(whatever).  Which is my original point -- if you know what you are
trying to do, you can usually figure out an alternative way to do it
under Windows, but it requires so thought and analysis by the programmer
himself.

Dennis