I have a multi-threaded application that does a lot of tracing in the
console window. Do I have to worry about synchronizing the access to the
Console.WriteLine method or this is taken care by the framework? I don't
think calls to the WriteLine method are atomic.

Why don't you think so?

<quote>
.NET Framework Class Library
Console Class

[...]

Thread Safety

This type is safe for multithreaded operations.

[...]

This class uses synchronized TextReader and TextWriter instances. Multiple
threads can concurrently read from or write to an instance of this type.
</quote>

Source:
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemConsoleClassTopic.asp

Fabian

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to