Hi guys,
so I'm pretty new to threading, I have a question in regards to the join function let me put some example code below
thanks
so I'm pretty new to threading, I have a question in regards to the join function let me put some example code below
import threading def funcOne(): print(threading.current_thread().getName()) def funcTwo(): print(threading.current_thread().getName()) t1 = threading.Thread(target = funcOne, name = "T one") t2 = threading.Thread(target = funcTwo, name = "T two") t1.start() t2.start() t1.join() t2.join() print("bye")so my question is, I start both threads with t1.start() and t2.start(), so what does the join function do here? from what I have took in, the join() function will make sure that thread finishes before running anymore threads/ functions, BUT as you can see I call t1.join() so now does main stop functioning until t1 finishes? if so is t2 still running?? does the t2.join() function get called after the thread t1 finishes?
thanks