Quiz 2

Questions relating to the Threading API are covered in this lesson.

We'll cover the following...

Question # 1

Consider the code snippet below:

Thread.new do
  Thread.stop()
end

"Main thread exiting"
Q

What is the output of the program?

A)

Program hangs because the child is stopped

B)

Program exits because the main thread exits

C)

An error is thrown

Press + to interact
Thread.new do
Thread.stop()
end
"Main thread exiting"
...