By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,994 Members | 1,080 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,994 IT Pros & Developers. It's quick & easy.

It is necessary to synchronize the Console.WriteLine calls?

P: n/a
Env: W2k, VS2005 Std

Hi everybody, I have a application with threads writing simultaneously
to the console with WriteLine. It is necessary the synchronization? I read
http://msdn2.microsoft.com/en-us/lib...le(VS.80).aspx but I
had a deadlock in this function with 2 threads.

Thx in advance,

Naldo Alcalde H.
Mar 29 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Naldo Alcalde <li*************@hotmail.com> wrote:
Env: W2k, VS2005 Std

Hi everybody, I have a application with threads writing simultaneously
to the console with WriteLine. It is necessary the synchronization? I read
http://msdn2.microsoft.com/en-us/lib...le(VS.80).aspx but I
had a deadlock in this function with 2 threads.


I find it very unlikely that you actually had a deadlock using
System.Console. However, if you did, I'm sure MS would be very
interested in knowing about it, as it would probably be a bug, given
that the documentation says it's thread-safe.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 29 '06 #2

P: n/a
Hi,

AFAIK it's thread safe. Almost all the articles,examples and code snipes you
find explaining multithreading you see Console.WriteLine() to show how the
different threads execute.

It could be a bug in 2.0 though.

An example will be interesting.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Naldo Alcalde" <li*************@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
Env: W2k, VS2005 Std

Hi everybody, I have a application with threads writing simultaneously
to the console with WriteLine. It is necessary the synchronization? I read
http://msdn2.microsoft.com/en-us/lib...le(VS.80).aspx but I
had a deadlock in this function with 2 threads.

Thx in advance,

Naldo Alcalde H.

Mar 29 '06 #3

P: n/a
Sorry but that problem has not happenned again.

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Naldo Alcalde <li*************@hotmail.com> wrote:
Env: W2k, VS2005 Std

Hi everybody, I have a application with threads writing simultaneously to the console with WriteLine. It is necessary the synchronization? I read http://msdn2.microsoft.com/en-us/lib...le(VS.80).aspx but I had a deadlock in this function with 2 threads.


I find it very unlikely that you actually had a deadlock using
System.Console. However, if you did, I'm sure MS would be very
interested in knowing about it, as it would probably be a bug, given
that the documentation says it's thread-safe.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Apr 6 '06 #4

P: n/a
excellent
---
Posted via www.DotNetSlackers.com
Aug 25 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.