-1

Possible Duplicate:
Calling Console.WriteLine from multiple threads

I am have test of CONSOLE APPLICATION for the c#

Question:

Has Console.WriteLine for THREAD SAFETY ?

In effect ,

is possible for no exceptions with :

Parallel.For(0, 1000000, p => Console.WriteLine("Hello Dears !"));

Thank for quick reponse !

Community
  • 1
  • 1
PRASHANT P
  • 1,527
  • 1
  • 16
  • 28

1 Answers1

1

Yes, using console I/O is thread safe:

"I/O operations using these streams are synchronized, which means multiple threads can read from, or write to, the streams."

http://msdn.microsoft.com/en-us/library/system.console.aspx

Related: Calling Console.WriteLine from multiple threads

Community
  • 1
  • 1
Guffa
  • 687,336
  • 108
  • 737
  • 1,005