Use a
Queue<T>[
^] to enqueue the received data and have another thread dequeue the data for processing.
If you are use .NET 4, then use the new
ConcurrentQueue<T>[
^] class. Check this link
BlockingCollection and IProducerConsumerCollection[
^]
Workflow can be:
1. Receive data on RS232 / Serial port.
2. Pre process data received.
3. Enqueue data in an Queue class.
4. Repeat, goto step 1
In another thread you then:
1. Dequeue an Queue class.
2. Post process data.
3. Do the your thing.
4. Repeat, goto step 1.