From: Eric Armstrong on
N Okia wrote:
> Tested it with cygwin under Windows XP, and it worked fine. Again,
> didn't have to hit spacebar for the thread to start up. Tried with
> One-Click Ruby on the same box, and it didn't work.
>
> Windows lack of standard fork is probably the problem here.
>
Ok, thanks much. One-click Ruby is /so/ convenient.
It's a real pity that threads don't work in it.

I have cygwin running on my machine at home. What's
the best way to get ruby running on it?

That works for me, at least. But the situation pretty
much kills my chances of distributing my timer app to
the world at large. Bummer.

(It's a simple little app. All it does is remind you
periodically to get off your chair and get some
exercise! A compiled executable would be ideal for
distribution, but I wouldn't have minded pointing
people to the one-click installer...)






From: khaines on
On Sat, 29 Jul 2006, Eric Armstrong wrote:

> Ok, thanks much. One-click Ruby is /so/ convenient.
> It's a real pity that threads don't work in it.

Threads do work on it. Try this:

-----

def alpha
Thread.new do
'a'.upto('z') {|a| puts a; sleep 2}
end
end

def numeric
Thread.new do
1.upto(55) {|n| puts n; sleep 1}
end
end

alpha
numeric

Thread.list.each {|t| t.join}

-----


My guess would be that the way curses is implented on Windows is causing
the thread blocking behavior.


Kirk Haines


From: N Okia on
> I have cygwin running on my machine at home. What's
> the best way to get ruby running on it?

Startup the cygwin setup.exe program. Select Ruby from the list of
packages to install. Finish the installation.

From: Eric Armstrong on
khaines(a)enigo.com wrote:
>
> Threads do work on (one-click Windows ruby).
>
> Try this:
>
> -----
>
> def alpha
> Thread.new do
> 'a'.upto('z') {|a| puts a; sleep 2}
> end
> end
>
> def numeric
> Thread.new do
> 1.upto(55) {|n| puts n; sleep 1}
> end
> end
>
> alpha
> numeric
>
> Thread.list.each {|t| t.join}
>
> -----
>
> My guess would be that the way curses is implented on Windows is causing
> the thread blocking behavior.
>
Interesting. I suppose it could be considered a
Curses bug, then.

So how would you implement a simple keyboard-controller
for threads on Windows?

Or are my options restricted to full-blown GUI
or nothing at all?



From: Chad Perrin on
On Sat, Jul 29, 2006 at 08:07:10AM +0900, Eric Armstrong wrote:
>
> So how would you implement a simple keyboard-controller
> for threads on Windows?
>
> Or are my options restricted to full-blown GUI
> or nothing at all?

You could always just implement your own text-based captive interface,
if that's what you really want.

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"The first rule of magic is simple. Don't waste your time waving your
hands and hopping when a rock or a club will do." - McCloctnick the Lucid