I'm developing a console application and I am stuck with no ideia on how to handle this issue.
My issue is the following:
My application runs two threads (1) that generates output and (2) one that waits for user to write a line on the console. My issue is that sometimes thread 1 may write several lines into the console, "splitting" what the user is writing and thus confusing him on what has been written.
For now I am studying two possibilities:
(1) Opening two consoles, one for output and one for input. For this approach I already have an ideia from resources I found online, but I don't like this solution as much.
(2) Somehow, reserving a line or a few lines that show only what the user is writing into thread 2 and the rest of the lines to show the output generated by thread 1.
Is the approachable two feasible? Are there any resource available for me to study? Or is there a more used approach?
Thanks!