I working with threads and i have huge amount of data in my database. I am working with entity framework. When assigning a select to the database, I need to process the data as soon as it arrives. And I have to repeat this process until the data is gone. As soon as the data comes(like reader.ReadLine()), I want it to run on threads and keep the data coming.
For example there is 1 million data in the database. 10 seconds for me to get all the data. 10 seconds to process them. But if I process the data as it comes, I think it will take less than 20 seconds and I can save time.
How can I do this?