Forum: Ruby unhandled exception in thread causes ruby to lose control

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F330a44fdf083a7a30488efc47759f3f?d=identicon&s=25 Shea Martin (Guest)
on 2006-03-23 19:23
(Received via mailing list)
<code>
Thread.abort_on_exception = true

t = Thread.new{
   puts "here"
   raise "exception"
}

sleep 3
puts "t thread is #{t.alive?}"

exit 0
</code>

The above code will cause ruby to eatup 100% cpu, for an infinite amount
of time on win32.  If Thread.abort_on_exception  is set to false, things
work as expected.

I think this is a bug. ruby 1.8.4 (2005-12-24) [i386-mswin32]

~S
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 James Britt (Guest)
on 2006-03-23 21:52
(Received via mailing list)
Shea Martin wrote:
> puts "t thread is #{t.alive?}"
>
> exit 0
> </code>
>
> The above code will cause ruby to eatup 100% cpu, for an infinite amount
> of time on win32.

WinXP pro, SP2: Code works just fine.

d:\temp>tex.rb
here
d:/temp/tex.rb:5: exception (RuntimeError)
         from d:/temp/tex.rb:3

d:\temp>


James
This topic is locked and can not be replied to.