The Main Thread

Even if you don’t explicitly create any threads, there is always at least one thread executing—the main thread in which your Ruby program is running. You can verify this by entering the following:

thread_main.rb

p( Thread.main )

This will display something like this:

#<Thread:0x28955c8 run>

Here, Thread is the thread’s class, 0x28955c8 (or some other number) is its hexadecimal object identifier, and run is the thread’s current status.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.0.85