ranking with thread