Creating threads, getting tickets

Creating N threads
Assigning M tickets

Threads are creating,running and joining (detaching)
Thread will take a ticket,wait, print info,wait in while loop