You have to start your thread like you did it in your code. The important thing is to wait for the thread to complete (even if it infinite loop) because without it, you program will stop immediatly. Just use
t.join()
And you code will run until t thread is over. If you want two thread, just do like this
t1.start()
t2.start()
t1.join()
t2.join()
And your two thread will run simultanously
For your crash problem, with multithreading, you have to look at Mutex for the IOerror