In the main program, we initialize the thread's list, to which we add the instance of each thread that is created. The total number of threads created is 10, while the i-index for the ith thread is passed as an argument to the ith thread:
my_func called by thread N°0
my_func called by thread N°1
my_func called by thread N°2
my_func called by thread N°3
my_func called by thread N°4
my_func called by thread N°5
my_func called by thread N°6
my_func called by thread N°7
my_func called by thread N°8
my_func called by thread N°9