The console class handles the thread synchronization for you.
From the documentation of Console:
I/O operations using these streams are synchronized, which means multiple threads can read from, or write to, the streams.
There is a bug in .NET 4.5 CLR which makes Console.WriteLine not work from multiple threads if you use Console.ReadKey. It is fixed in some Windows versions, but in 8.1 Windows Update does not find it yet.
Infrequent hangs in a multi-threaded C# console application when using Console.Writeline() or Console.Write()
Using Console.WriteLine in a Timer why it would appear to exit?
Multiple threads write to the same output when using Console.WriteLine
, generally your screen by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With