lucasmcdonald3
9/28/2018 - 4:46 PM

Multithreading

while True:
  threads = []
  
  # first thread
  t1 = Thread(target = func1, args = [arg1, arg2])
  threads.append(t1)
  t1.start()
  # second thread
  t2 = Thread(target = func2, args = [arg1, arg2])
  threads.append(t2)
  t2.start()
  
  # Spin (nicely, so we don't chew up cycles)
  t1.join()
  t2.join()