From: Benoit Cerrina Date: 2002-03-20T17:02:27+09:00 Subject: Re: Development of Windows version of Ruby > 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. > as far as I know ruby threads are not mapped to real threads and if for example one of the threads does a blocking call to a non ruby function in a lib all threads are blocked. However something similar could be done with forking actually creating another OS thread and ruby performing its own copy on write on the shared data. > And, as a brief summary of a point I alluded to in an earlier post: > > Ruby right now, today, can be used to write a Windows program which > uses the facilities provided by a Windows OS, and runs fine on Windows. > > It can also be used to write a UNIX program which uses the facilities > provided by a UNIX OS, and runs fine on UNIX. > > The fact that the two OS's are in some areas incompatible is not > a reflection on Ruby, and is not a language issue. If I were to take > a C program written to run under Windows and using the facilites > provided by a Windows OS, and try to compile and run it under UNIX, > there is a good chance (depending on what facilities it was using) > that it would fail. This is not a problem with C, and cannot be* > fixed by writing a different C runtime library module. I fundamentally agree, part of the problem is that fork and such are presented as part of the language and not clearly identified as being platform dependent. Someone suggested putting those services in a separate namespace (module) I think it would be a good idea, if fork was called POSIX::fork I'm sure people would expect it not to work as well on windows. After all the oposite is true and there are things which are doable on windows and not on UNIX (even if they have and equivalent). Benoit