Why not use threads?
Consider this: put each residue in the stream, and then run both of them. After that, the program waits for them. Only after completing both threads with your tasks (reading data) can you continue.
Remember that streams cannot directly modify data from another stream, so I can suggest using Invoke or static variables, depending on what you might need.
If possible, you can use the Task / Parallel library, which already has some useful methods to help you with this.
A background worker is also a way.
source share