I am developing a windows forms application ( c# ), and while program is running, it creates objects adds them to a list. I have to process the items in the list , with FIFO ( first in first out ). I want to do this in a backgroundthread and i have to process them in order, number 1 , number 2, number 3 and so on. And as soon as an item gets added to the list i want to process it. So i have to have something to check that list.
What is the best way to achieve this?
I know that blockingcollection does something similar, that it waits for an item to be added before processing it.
I can use a single thread with the Queue and just while(true) and take items if there is any?
What do you think?