[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: fork not available?

walter

9/19/2003 5:26:00 PM

Ok so I sent this out a bit too early.

after looking in the archives some more I see that fork and popen("-
") do not work with Windows. I see ri does mention that IO.popen is
Not available on all platforms, but it does not mention this for
Kernel.fork.

I basically have some setup code, then would like two separate
threads (real threads or processes, unless someone can point me in a
way to get around the blocking issues), and then join and perform
some finishing code.

Currently the total process take about 20 hours. I want to get it so
that it can run in less than 12 basically overnight. Do I have to
split the parts up as separate programs and deal with the sharing of
data on my own?

any insight would be greatly appreciated.

Thanks,

Walt


> I am running windows 2000 using the PragProgs install.
>
> I have tried fork but get an unimplemented on this machine error. I
> have tried this on multiple windows 2000 machines and get the same
> error.
>
> I have tried IO.popen("-") but just get an error stating that "-" is
> not recognized.
>
> I am trying to get a long running program to use 2 separate
> processors. I have tried using Ruby's threads but the code is very
> database intensive and appears to block a lot so I do not see a speed
> improvement. The code is separated enough that I should be able to
> cut the overall time significantly if I can get the 2 parts to run on
> separate processors.
>
> I am missing something stupid? Any thoughts?
>
>
> Thanks,
>
> Walt
> *****************************************************
> Walter Szewelanczyk
> IS Director
> M.W. Sewall & CO. email : walter@mwsewall.com
> 259 Front St. Phone : (207) 442-7994 x 128
> Bath, ME 04530 Fax : (207) 443-6284
> *****************************************************
>
>


*****************************************************
Walter Szewelanczyk
IS Director
M.W. Sewall & CO. email : walter@mwsewall.com
259 Front St. Phone : (207) 442-7994 x 128
Bath, ME 04530 Fax : (207) 443-6284
*****************************************************


1 Answer

Shashank Date

9/19/2003 9:43:00 PM

0

Hi,

<walter@mwsewall.com> wrote in message
> Ok so I sent this out a bit too early.
>
> after looking in the archives some more I see that fork and popen("-
> ") do not work with Windows. I see ri does mention that IO.popen is
> Not available on all platforms, but it does not mention this for
> Kernel.fork.
>
> I basically have some setup code, then would like two separate
> threads (real threads or processes, unless someone can point me in a
> way to get around the blocking issues), and then join and perform
> some finishing code.

You may want to take a look at the Windows version of popen3 on RAA:

http://raa.ruby-lang.org/list.rhtml?name=w...

It is still in its beta version, but I can tell you from my personal
experience
that the author of this package (Park Heesob) is very responsive and
will be willing to work with you through bugs and all.

(Park, I know I have spoken on your behalf ...please excuse me if I have
overstated and encroached on your busy schedule)

-- shanko