Get The Most Affordable Hosting in the World!

Starting at just $1.87/month, Vercaa offers unbeatable pricing for world-class web hosting services.

Fast, reliable, and secure hosting to power your website without breaking the bank. Plus, enjoy a free CDN for faster loading times worldwide!

Get Started Now!

The join() method in thread class blocks the calling thread until the thread whose join() method is called terminates. The termination may be either normal, because of an unhandled exception − or until the optional timeout occurs. It can be called many times. The join() raises a RuntimeError if an attempt is made to join the current thread. Attempt to join() a thread before it has been started also raises the same exception.

Syntax

thread.join(timeout)

Parameters

  • timeout − it should be a floating point number specifying a timeout for which the thread is to be blocked.

The join() method always returns None. you must call is_alive() after join() to decide whether a timeout happened − if the thread is still alive, the join() call timed out. When the timeout argument is not present or None, the operation will block until the thread terminates.

A thread can be joined many times.

Example

thread1.start() thread2.start() thread1.join() thread2.join()

is_alive() method

This method returns whether the thread is alive. It returns True just before calling run() method and until just after the run() method terminates.

 

 

The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.

هل كانت المقالة مفيدة ؟ 1 أعضاء وجدوا هذه المقالة مفيدة (1 التصويتات)