How to process more than 500k data from database using multithreading

How many thread I have to made and anyone can give ideas about the code. How it will process?