Allocating thread for each puzzle piece matching process