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 start_new_thread() function included in the _thread module is used to create a new thread in the running program.
Syntax
This function starts a new thread and returns its identifier.
Parameters
-
function − Newly created thread starts running and calls the specified function. If any arguments are required for the function, that may be passed as parameters args and kwargs.
Example
It will produce the following output −
Thread name: Thread-1 Count: 1 Thread name: Thread-2 Count: 1 Thread name: Thread-1 Count: 2 Thread name: Thread-1 Count: 3 Thread name: Thread-2 Count: 2 Thread name: Thread-1 Count: 4 Thread name: Thread-1 Count: 5 Thread name: Thread-2 Count: 3 Thread name: Thread-2 Count: 4 Thread name: Thread-2 Count: 5 Traceback (most recent call last): File "C:\Users\user\example.py", line 17, in <module> while True: KeyboardInterrupt
The program goes in an infinite loop. You will have to press "ctrl-c" to stop.
The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.