threads and errors

C

Charles Mills

What techniques are available for handling errors that occur in
threads?

For example how do I find out that an error occured in t below?

t = Thread.new { raise "error" }

I need to be able to check on the error status of threads from their
parent. Something like the following would be ideal - but I know this
won't do what I want:

begin
Thread.new { raise "error"}
rescue
puts $! # in a strange world prints "error", but in actuality does
nothing
end


-Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top