Add a thread for frequency calculation.