Since this can’t be solved so easily how can I implement 1 thread that writes strings to a file / buffer line by line using Console.WriteLine() and another thread that reads those strings from the same file / buffer also line by line ? I guess I need to:
- redirect Console to file / buffer
- read file / buffer thread save, when a line is written it must be read by the other thread
- make that asynchronous (no
ReadToEnd(), it must be live)
I would like to do that with a buffer though.
Solution with file:
Works line by line and doesn’t miss one.