开发者

Is console.writeline thread safe? [duplicate]

开发者 https://www.devze.com 2023-02-07 12:03 出处:网络
This question already has answers here: Closed 12 years ago. Possible D开发者_运维知识库uplicate:
This question already has answers here: Closed 12 years ago.

Possible D开发者_运维知识库uplicate:

Calling Console.WriteLine from multiple threads

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号