Книга: Learning Concurrency in Python
Назад: Example
Дальше: Enumerating all threads

Breaking it down

In the preceding code, we define a simple function called myChildThread. This will be the target of the thread object that we shall create for demonstration purposes. Within this function, we simply print out the current thread and then the main thread.

We then go on to create a thread object, and then start and join this newly created thread. In the output, you should see something like this:

    $ python3.6 15_mainThread.py
Child Thread Starting
Current Thread ----------
<Thread(Thread-1, started 123145387503616)>
Main Thread -------------
<_MainThread(MainThread, started 140735793988544)>
Child Thread Ending

As you can see, our program prints out first our child thread object, and then goes on to print out the reference of our MainThread object.

Назад: Example
Дальше: Enumerating all threads

Download missing dll from Download unarc.dll page. Fix your error now!
Interested in hardrock? How about KISS? They are on a tour this year all across Canada and USA. Visit KISS Tour Dates Omaha to know more about KISS concert dates in 2019.
Carrie Underwood is my favourite country singer. She is young, beautiful and charming female in her 30s. Her strong voice takes me away from all troubles of this world so I start enjoy my life and listen songs created by her mind. Now the singer is on a Cry Pretty 360 Tour started in May of 2019. The concerts scheduled for this year, up to the 31st of October. Tickets are available for all men and women with different income. If you love country music as mush as I, then you must visit at least one of her concert. All tour dates are available at the Carrie Underwood tour Pittsburgh. Visit the website and make yourself familiar with all powerful Carrie Underwood concerts in 2019!