Is console.writeline thread safe? [duplicate]
Asked Answered
A

1

50

Possible Duplicate:
Calling Console.WriteLine from multiple threads

Just want to know if multiple threads call Console.WriteLine, will it cause a deadlock?

Autarch answered 27/1, 2011 at 3:43 Comment(2)
Deadlocks would be much less likely than race conditions (assuming that it's not thread-safe)Fossil
It's more likIf it isn't threadsafe.ely to produce output like this.Stitt
B
71

It's safe! From the .NET API browser:

Console I/O Streams

[...]

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

Bartram answered 27/1, 2011 at 3:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.