Skip to content

Instantly share code, notes, and snippets.

@iraSenthil
Created April 20, 2011 01:35
Show Gist options
  • Save iraSenthil/930152 to your computer and use it in GitHub Desktop.
Save iraSenthil/930152 to your computer and use it in GitHub Desktop.
Each thread has a separate stack
static void Main(string[] args)
{
//Thread has separate call stack
Thread newThread = new Thread(()=> Print(5));
newThread.Start();
Print(3);
Console.ReadLine();
}
static void Print(int x)
{
for (int i = 0; i < x; i++)
{
Console.Write(x);
Thread.Sleep(10);
}
}
//Output
//53535355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment