In the following console application, if I place a breakpoint on the last line Go(); and execute till breakpoint (in debug mode) by pressing F5, the results are not quite different on each run.
Console can be blank (does not output anything):
or it can output just part of the results on another run:
or, on very rare occasions, the results are "complete" ("actualized"):
If I debug by F10 (Step Over) or F11 (Step into), the results of executing are output into console window immediately.
Why are such differences?
Suppose I am debugging an application using 3d party libraries to source codes of which which I do not have aссess.
Is it possible to ensure the output from them without stepping into their code?
The code of console application:
using System;
using System.Threading;
namespace _5_2
{
class ThreadNaming
{
static void Main()
{
Thread.CurrentThread.Name = "main";
Thread worker = new Thread(Go);
Thread worker2 = new Thread(Go);
worker.Name = "1111";
worker.Start();
//string just4breakPoint = "aaa";
worker2.Name = "2222";
worker2.Start();
Go();
Console.ReadLine();
}
static void Go()
{
Console.WriteLine
("Hello from " + Thread.CurrentThread.Name);
}
}
}