From: "Hal E. Fulton" Date: 2002-09-08T15:38:59+09:00 Subject: Re: a problem of waitting and printting out message ----- Original Message ----- From: "Reimer Behrends" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Sunday, September 08, 2002 1:32 AM Subject: Re: a problem of waitting and printting out message > Maggie Xiao (mxiao@ee.ualberta.ca) wrote: > [...] > > I should construct a program which should wait for the specified time > > and then print out the specified message. Meanwhile control of the > > shell should be returned to the user. ie. The program must be > > non-blocking. is there any way to construct it in pure ruby way? Or > > my only way is to using extending ruby with c? > > Is the following what you are looking for? > > if fork then > # parent process > exit! > else > # child process > sleep 10 > puts "Now!" > end I think Maggie is a Windows user (unless my memory is wrong). And this solution won't work on Windows. Since leaving the Cygwin DLL behind, we have lost fork() and popen3 and gained a thread- related bug that cripples many apps. Probably one of those situations where you have to take two steps back in order to take three steps forward. Hal