[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

at_exit, trap sigint, and sleep. no good in 1.8, ok in 1.6

From: homer nile <homernile@...>
Date: 2004-11-02 00:03:54 UTC
List: ruby-core #3678
Any ideas about why the following code hangs in 1.8
(under WinXP) but works fine in 1.6.  (This is a major
simplification of some Ctrl-C handling from a larger
project.  I don't just have a thing against cats.) 
The run results are below.  I've been told on
ruby_talk that this works fine on 1.8 on Linux.

Thanks.
(I apologize if this is not suitable for ruby_core. 
Since it works differently on Windows and Linux, I
decided to take a chance that it would be relevant to
the implementation gurus.)


----- dog.rb  -------------------------------------

at_exit {
	puts "Dog: at_exit"
	
	trap("SIGINT") {
		puts "Dog: killing cat..."
		Cat.die
		puts "Dog: cat whacked."
	}
	
	Cat.run
	puts "Dog: cat runs no more."
}

----- cat.rb  -------------------------------------

require "dog"

module Cat
	def Cat.run
		@@done = false
		until @@done
			puts "Cat: yawn"
			sleep(2)
		end
		puts "Cat: eehhkk."
	end
	
	def Cat.die
		@@done = true
		puts "Cat: eeeiiiiyyyeee!"
	end
end

----- results  ------------------------------------

> \ruby-1.6.8\bin\ruby.exe -v cat.rb
ruby 1.6.8 (2002-12-24) [i586-mswin32]
Dog: at_exit
Cat: yawn
Cat: yawn
[I press Ctrl+c]
Dog: killing cat...
Cat: eeeiiiiyyyeee!
Dog: cat whacked.
Cat: eehhkk.
Dog: cat runs no more.


> \ruby-1.8.2\bin\ruby.exe -v cat.rb
ruby 1.8.2 (2004-07-29) [i386-mswin32]
Dog: at_exit
Cat: yawn
Cat: yawn
Cat: yawn
[I press Ctrl+c]
Dog: killing cat...
Cat: eeeiiiiyyyeee!
Dog: cat whacked.

[and here we stay forever.]







__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

In This Thread

Prev Next